From: Sabrina Dubroca Date: Tue, 10 Mar 2015 20:03:54 +0000 (+0100) Subject: fib_trie: call fib_table_flush_external under RTNL X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6dede75b7e8ed4af31c3b06aec84401a5db88be9;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git fib_trie: call fib_table_flush_external under RTNL Move rtnl_lock() before the call to fib4_rules_exit so that fib_table_flush_external is called under RTNL. Fixes: 104616e74e0b ("switchdev: don't support custom ip rules, for now") Signed-off-by: Sabrina Dubroca Acked-by: Alexander Duyck Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller --- diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 7cda3b0521d8..a0b69ae8be1c 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -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;