diff options
author | asomers <asomers@FreeBSD.org> | 2014-06-06 22:14:25 +0000 |
---|---|---|
committer | asomers <asomers@FreeBSD.org> | 2014-06-06 22:14:25 +0000 |
commit | 218f93e5f8ff4d66b5b39b99db1d741e7067e773 (patch) | |
tree | d8a1ded330c892eb47b17961b14ff8ea1324d6da /sys/netinet | |
parent | 322a1ee4a01630c2c5cb0ecfd4cb5b7aabe46793 (diff) | |
download | FreeBSD-src-218f93e5f8ff4d66b5b39b99db1d741e7067e773.zip FreeBSD-src-218f93e5f8ff4d66b5b39b99db1d741e7067e773.tar.gz |
MFC changes related to PR kern/189089. Unlike CURRENT, stable/10 does not
panic when you attempt to remove the IP address. But it still fails to
remove the address.
MFC r265094
Add regression test for PR kern/189088.
MFC r265092
Fix a panic when removing an IP address from an interface, if the same
address exists on another interface. The panic was introduced by change
264887, which changed the fibnum parameter in the call to rtalloc1_fib() in
ifa_switch_loopback_route() from RT_DEFAULT_FIB to RT_ALL_FIBS. The
solution is to use the interface fib in that call. For the majority of
users, that will be equivalent to the legacy behavior.
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/in.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 13cce0f..be26ecd 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -987,11 +987,9 @@ in_scrubprefix(struct in_ifaddr *target, u_int flags) { struct in_ifaddr *ia; struct in_addr prefix, mask, p, m; - int error = 0, fibnum; + int error = 0; struct sockaddr_in prefix0, mask0; - fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : target->ia_ifp->if_fib; - /* * Remove the loopback route to the interface address. * The "useloopback" setting is not consulted because if the @@ -1046,6 +1044,10 @@ in_scrubprefix(struct in_ifaddr *target, u_int flags) } if ((target->ia_flags & IFA_ROUTE) == 0) { + int fibnum; + + fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : + target->ia_ifp->if_fib; rt_addrmsg(RTM_DELETE, &target->ia_ifa, fibnum); return (0); } |