Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Feb 2007 19:22:45 GMT
From:      Stefan Bethke<stb@lassitu.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   conf/109498: Enable cloning of tun/tap through rc.conf cloned_interfaces
Message-ID:  <200702241922.l1OJMj9Q066883@www.freebsd.org>
Resent-Message-ID: <200702241930.l1OJU6Rf097737@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         109498
>Category:       conf
>Synopsis:       Enable cloning of tun/tap through rc.conf cloned_interfaces
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 24 19:30:06 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Stefan Bethke
>Release:        FreeBSD 6.2
>Organization:
>Environment:
>Description:
tap(5) and tun(5) do not support the create/destroy methods for cloning, but rely on their character devices being opened to create the respective network interfaces. This makes it awkward to create tap or tun interfaces early enough in the boot process to i.e. be able to add a tap interface to a bridge, or reference an interface from a firewall script.

>How-To-Repeat:

>Fix:
--- /usr/src/etc/network.subr   Mon Nov  6 17:46:06 2006
+++ network.subr        Sat Feb 24 19:59:17 2007
@@ -429,7 +429,14 @@
        _prefix=
        _list=
        for ifn in ${cloned_interfaces}; do
-               ifconfig ${ifn} create
+               case ${ifn} in
+                       tap*|tun*)
+                               echo -n >/dev/${ifn}
+                               ;;
+                       *)
+                               ifconfig ${ifn} create
+                               ;;
+               esac
                if [ $? -eq 0 ]; then
                        _list="${_list}${_prefix}${ifn}"
                        [ -z "$_prefix" ] && _prefix=' '
r
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200702241922.l1OJMj9Q066883>