>Number:         187551
>Category:       bin
>Synopsis:       ifconfig should change its process fib when configuring an 
>interface with nondefault fib
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 13 19:40:01 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Alan Somers
>Release:        11.0-CURRENT  r262867
>Organization:
Spectra Logic
>Environment:
FreeBSD alans-fbsd-head 11.0-CURRENT FreeBSD 11.0-CURRENT #39 r263109M: Thu Mar 
13 11:31:56 MDT 2014     
[email protected]:/vmpool/obj/usr/home/alans/freebsd/head/sys/GENERIC  
amd64
>Description:
When configuring an interface with a nondefault fib, ifconfig(8) should changes 
its process fib to match the interface fib.  If it does not, and the user does 
not think to, then the new interface's subnet route will appear in FIB 0.  Note 
that this only matters when net.add_addr_allfibs=0
>How-To-Repeat:
# ifconfig tap0 create
# ifconfig tap0 192.0.2.2/24 fib 2
# setfib 2 netstat -rn -f inet
Routing tables (fib: 2)
# setfib 0 netstat -rn -f inet
Routing tables

Internet:
Destination        Gateway            Flags    Netif Expire
default            10.1.0.1           UGS       em0
10.1.0.0/20        link#1             U         em0
10.1.3.220         link#1             UHS       lo0
127.0.0.1          link#2             UH        lo0
192.0.2.0/24       link#3             U        tap0
192.0.2.2          link#3             UHS       lo0

>Fix:
==== //SpectraBSD/stable/sbin/ifconfig/iffib.c#2 (text) ====

@@ -76,6 +76,8 @@
 
        strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name));
        ifr.ifr_fib = fib;
+       if (setfib(fib) != 0) 
+               warn("setfib");
        if (ioctl(s, SIOCSIFFIB, (caddr_t)&ifr) < 0)
                warn("ioctl (SIOCSIFFIB)");
 }

>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to