Skip to content

Commit

Permalink
fib_trie: call fib_table_flush_external under RTNL
Browse files Browse the repository at this point in the history
Move rtnl_lock() before the call to fib4_rules_exit so that
fib_table_flush_external is called under RTNL.

Fixes: 104616e ("switchdev: don't support custom ip rules, for now")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Acked-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sabrina Dubroca authored and David S. Miller committed Mar 11, 2015
1 parent 8a08919 commit 6dede75
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/ipv4/fib_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1171,11 +1171,12 @@ static void ip_fib_net_exit(struct net *net)
{
unsigned int i;

rtnl_lock();

#ifdef CONFIG_IP_MULTIPLE_TABLES
fib4_rules_exit(net);
#endif

rtnl_lock();
for (i = 0; i < FIB_TABLE_HASHSZ; i++) {
struct hlist_head *head = &net->ipv4.fib_table_hash[i];
struct hlist_node *tmp;
Expand Down

0 comments on commit 6dede75

Please sign in to comment.