ipv4: Do not allow MAIN to be alias for new LOCAL w/ custom rules
[firefly-linux-kernel-4.4.55.git] / net / ipv4 / fib_frontend.c
index 63566ec54794db8213c2c935d75c2ba32dd71d61..4e60dae86df576ade9cf604d810b3140bb072778 100644 (file)
@@ -85,7 +85,7 @@ struct fib_table *fib_new_table(struct net *net, u32 id)
        if (tb)
                return tb;
 
-       if (id == RT_TABLE_LOCAL)
+       if (id == RT_TABLE_LOCAL && !net->ipv4.fib_has_custom_rules)
                alias = fib_new_table(net, RT_TABLE_MAIN);
 
        tb = fib_trie_table(id, alias);