FreeBSD Bugzilla – Attachment 142112 Details for
Bug 189089
Panic when removing an IP address from an interface, if the same address exists on another interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.84 KB, created by
Alan Somers
on 2014-04-28 23:50:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Alan Somers
Created:
2014-04-28 23:50:00 UTC
Size:
2.84 KB
patch
obsolete
>Index: sys/netinet/in.c >=================================================================== >--- sys/netinet/in.c (revision 265061) >+++ sys/netinet/in.c (working copy) >@@ -696,11 +696,9 @@ > { > 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. > */ >@@ -712,6 +710,8 @@ > eia = in_localip_more(target); > > if (eia != NULL) { >+ int fibnum = target->ia_ifp->if_fib; >+ > error = ifa_switch_loopback_route((struct ifaddr *)eia, > (struct sockaddr *)&target->ia_addr, fibnum); > ifa_free(&eia->ia_ifa); >@@ -736,6 +736,10 @@ > } > > 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); > } >Index: tests/sys/netinet/fibs_test.sh >=================================================================== >--- tests/sys/netinet/fibs_test.sh (revision 265061) >+++ tests/sys/netinet/fibs_test.sh (working copy) >@@ -213,6 +213,45 @@ > } > > >+# Regression test for a panic introduced in change 264887 >+# Create two tap interfaces and assign them both the same IP address but with >+# different netmasks, and both on the default FIB. Then remove one's IP >+# address. Hopefully the machine won't panic. >+atf_test_case same_ip_multiple_ifaces_fib0 cleanup >+same_ip_multiple_ifaces_fib0_head() >+{ >+ atf_set "descr" "Can remove an IP alias from an interface when the same IP is also assigned to another interface." >+ atf_set "require.user" "root" >+ atf_set "require.config" "fibs" >+} >+same_ip_multiple_ifaces_fib0_body() >+{ >+ ADDR="192.0.2.2" >+ MASK0="24" >+ MASK1="32" >+ >+ # Unlike most of the tests in this file, this is applicable regardless >+ # of net.add_addr_allfibs >+ >+ # Setup the interfaces, then remove one alias. It should not panic. >+ setup_tap 0 ${ADDR} ${MASK0} >+ TAP0=${TAP} >+ setup_tap 0 ${ADDR} ${MASK1} >+ TAP1=${TAP} >+ ifconfig ${TAP1} -alias ${ADDR} >+ >+ # Do it again, in the opposite order. It should not panic. >+ setup_tap 0 ${ADDR} ${MASK0} >+ TAP0=${TAP} >+ setup_tap 0 ${ADDR} ${MASK1} >+ TAP1=${TAP} >+ ifconfig ${TAP0} -alias ${ADDR} >+} >+same_ip_multiple_ifaces_fib0_cleanup() >+{ >+ cleanup_tap >+} >+ > # Regression test for kern/187550 > atf_test_case subnet_route_with_multiple_fibs_on_same_subnet cleanup > subnet_route_with_multiple_fibs_on_same_subnet_head() >@@ -309,6 +348,7 @@ > atf_add_test_case arpresolve_checks_interface_fib > atf_add_test_case loopback_and_network_routes_on_nondefault_fib > atf_add_test_case default_route_with_multiple_fibs_on_same_subnet >+ atf_add_test_case same_ip_multiple_ifaces_fib0 > atf_add_test_case subnet_route_with_multiple_fibs_on_same_subnet > atf_add_test_case udp_dontroute > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 189089
: 142112