summaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2018-01-07 12:45:14 +0200
committerDavid S. Miller <davem@davemloft.net>2018-01-07 21:29:41 -0500
commit922c2ac82e37523d1f0efaac8978ef573071d889 (patch)
tree840875b6412b56f9e1894ab74c7dd08792f1f4dd /net/ipv6/route.c
parent4a8e56ee2c8551e674f69ba007aabede8f0b88d9 (diff)
downloadlinux-922c2ac82e37523d1f0efaac8978ef573071d889.tar.bz2
ipv6: Take table lock outside of sernum update function
The next patch is going to allow dead routes to remain in the FIB tree in certain situations. When this happens we need to be sure to bump the sernum of the nodes where these are stored so that potential copies cached in sockets are invalidated. The function that performs this update assumes the table lock is not taken when it is invoked, but that will not be the case when it is invoked by the tree walker. Have the function assume the lock is taken and make the single caller take the lock itself. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index f62d24948aa2..a3bfce71c861 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1353,7 +1353,9 @@ out:
/* Update fn->fn_sernum to invalidate all cached dst */
if (!err) {
+ spin_lock_bh(&ort->rt6i_table->tb6_lock);
fib6_update_sernum(ort);
+ spin_unlock_bh(&ort->rt6i_table->tb6_lock);
fib6_force_start_gc(net);
}