conf/109498: Enable cloning of tun/tap through rc.conf cloned_interfaces

Stefan Bethke stb at lassitu.de
Sat Feb 24 19:30:07 UTC 2007


>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:


More information about the freebsd-bugs mailing list