]> git.baikalelectronics.ru Git - kernel.git/commit
net: Flush local routes when device changes vrf association
authorDavid Ahern <dsa@cumulusnetworks.com>
Thu, 10 Dec 2015 18:25:24 +0000 (10:25 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Dec 2015 04:58:44 +0000 (23:58 -0500)
commitdc90c8f45b47855c22995d3135817f8f2ba76de3
tree93cf3d05956b28bf4d69049da97c53ef032522dd
parent279a0e9100dc6df26a0b88d1b0a2a6dd59434963
net: Flush local routes when device changes vrf association

The VRF driver cycles netdevs when an interface is enslaved or released:
the down event is used to flush neighbor and route tables and the up
event (if the interface was already up) effectively moves local and
connected routes to the proper table.

As of 0fa944d93824 the local route is left hanging around after a link
down, so when a netdev is moved from one VRF to another (or released
from a VRF altogether) local routes are left in the wrong table.

Fix by handling the NETDEV_CHANGEUPPER event. When the upper dev is
an L3mdev then call fib_disable_ip to flush all routes, local ones
to.

Fixes: 0fa944d93824 ("ipv4: fix to not remove local route on link down")
Cc: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_frontend.c