summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2017-08-03 13:28:23 +0200
committerDavid S. Miller <davem@davemloft.net>2017-08-04 00:36:00 +0200
commit9217d8c2fe743f02a3ce6d430fe3b5d514fd5f1c (patch)
tree1f452e1be64610e5fec55c98bec40aaff8eeb4a0 /net/ipv6
parentipv6: fib: Unlink replaced routes from their nodes (diff)
downloadlinux-9217d8c2fe743f02a3ce6d430fe3b5d514fd5f1c.tar.xz
linux-9217d8c2fe743f02a3ce6d430fe3b5d514fd5f1c.zip
ipv6: Regenerate host route according to node pointer upon loopback up
When the loopback device is brought back up we need to check if the host route attached to the address is still in the FIB and regenerate one in case it's not. Host routes using the loopback device are always inserted into and removed from the FIB under RTNL (under which this function is called), so we can test their node pointer instead of the reference count in order to check if the route is in the FIB or not. Tested using the following script from Nicolas mentioned in commit a220445f9f43 ("ipv6: correctly add local routes when lo goes up"): $ ip link add dummy1 type dummy $ ip link set dummy1 up $ ip link set lo down ; ip link set lo up The host route is correctly regenerated. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/addrconf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 3c46e9513a31..e8e4f867b994 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3066,7 +3066,7 @@ static void init_loopback(struct net_device *dev)
* lo device down, release this obsolete dst and
* reallocate a new router for ifa.
*/
- if (!atomic_read(&sp_ifa->rt->rt6i_ref)) {
+ if (!sp_ifa->rt->rt6i_node) {
ip6_rt_put(sp_ifa->rt);
sp_ifa->rt = NULL;
} else {