[Differential] D8904: inet: Fix routing issue by calling if_up()
sepherosa_gmail.com (Sepherosa Ziehau)
phabric-noreply at FreeBSD.org
Thu Jan 5 08:16:04 UTC 2017
sepherosa_gmail.com added a comment.
In https://reviews.freebsd.org/D8904#185970, @karels wrote:
> I think the change is a step in the right direction. Certainly, "ifconfig xxN down" followed by an implicit UP should not cause any change to the routing table. Does anyone know why the "down" is removing the route? That seems wrong to me.
IMHO, it's mainly because the radix tree only uses the target address to do the search. So if you don't remove the prefix routes when bringing down the interface, radix search will end up w/ the route w/ a stopped interface; callers of the radix search don't have options to change this behaviour.
If we don't delete the prefix routes if the interface is down, the following senario will not work:
GW --- NET_A --- if0 HOST1
| if1
| |
+---- NET_B ----------+
Given HOST1's default gwy is GW. If if1 is brought down, but the NET_B's prefix route is not deleted, HOST1 will not be able to reach NET_B anymore, since the radix search always ends up w/ the route backed by if1.
REVISION DETAIL
https://reviews.freebsd.org/D8904
EMAIL PREFERENCES
https://reviews.freebsd.org/settings/panel/emailpreferences/
To: sepherosa_gmail.com, delphij, royger, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, adrian, bz, gnn, hiren, glebius, rwatson, karels
Cc: hrs, freebsd-net-list
More information about the freebsd-net
mailing list