kern/150481: freebsd 8.1 - ifdown - ifup - loopback route keeps

Ingo Flaschberger if at xip.at
Sat Sep 11 01:40:04 UTC 2010


>Number:         150481
>Category:       kern
>Synopsis:       freebsd 8.1 - ifdown - ifup - loopback route keeps
>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:   Sat Sep 11 01:40:03 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Ingo Flaschberger
>Release:        8.1 stable
>Organization:
crossip communications gmbh
>Environment:
FreeBSD xxx 8.1-STABLE FreeBSD 8.1-STABLE
>Description:
in raw_ip.c when a interface comes up with IFF_UP at the new added loopback interface the IFA_RTSELF is not set.
(13 year old bug!)


>How-To-Repeat:
without multipath:
ifconfig em3 10.40.40.3/24
ifconfig down em3
# all ok
ifconfig up em4 
# all ok
ifconfig down em4
# loopback route not deleted (not tested)

with multipath:
ifconfig em3 10.40.40.3/24
ifconfig down em3
# all ok
ifconfig up em4 
# all ok
ifconfig down em4
# loopback route not deleted 
ifconfig up em4
# 2 loopback routes
..

and when setting only a /32 ost route at the interface,
freebsd crashes after the 2nd ifconfig up
>Fix:
see attached patch

Patch attached with submission follows:

--- /usr/src/sys/netinet/raw_ip.c	2010-05-02 16:36:15.000000000 +0000
+++ /router/usr/src/sys/netinet/raw_ip.c	2010-09-11 01:28:24.000000000 +0000
@@ -755,6 +755,8 @@
 		if (err == 0)
 			ia->ia_flags |= IFA_ROUTE;
 		err = ifa_add_loopback_route((struct ifaddr *)ia, sa);
+		if (err == 0)
+		        ia->ia_flags |= IFA_RTSELF;
 		ifa_free(&ia->ia_ifa);
 		break;
 	}


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list