]> git.baikalelectronics.ru Git - kernel.git/commit
net: Don't delete routes in different VRFs
authorMark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Sun, 4 Sep 2016 22:20:20 +0000 (10:20 +1200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 6 Sep 2016 20:56:13 +0000 (13:56 -0700)
commit0b000b29c23ba251d78d981f893907f20fea701b
tree817eb48162ca954a29d301a60d2792ab1af47eb4
parenta0c849ffbc81aad7f8ccecaf4df7c0c645fbc9f3
net: Don't delete routes in different VRFs

When deleting an IP address from an interface, there is a clean-up of
routes which refer to this local address. However, there was no check to
see that the VRF matched. This meant that deletion wasn't confined to
the VRF it should have been.

To solve this, a new field has been added to fib_info to hold a table
id. When removing fib entries corresponding to a local ip address, this
table id is also used in the comparison.

The table id is populated when the fib_info is created. This was already
done in some places, but not in ip_rt_ioctl(). This has now been fixed.

Fixes: 3d4f81d3f6ea ("net: Add routes to the table associated with the device")
Acked-by: David Ahern <dsa@cumulusnetworks.com>
Tested-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ip_fib.h
net/ipv4/fib_frontend.c
net/ipv4/fib_semantics.c