aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_frontend.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/fib_frontend.c')
-rw-r--r--net/ipv4/fib_frontend.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index e787d2151152..62bd791c204e 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -869,19 +869,14 @@ static int nl_fib_lookup_init(struct net *net)
869 nl_fib_input, NULL, THIS_MODULE); 869 nl_fib_input, NULL, THIS_MODULE);
870 if (sk == NULL) 870 if (sk == NULL)
871 return -EAFNOSUPPORT; 871 return -EAFNOSUPPORT;
872 /* Don't hold an extra reference on the namespace */
873 put_net(sk->sk_net);
874 net->ipv4.fibnl = sk; 872 net->ipv4.fibnl = sk;
875 return 0; 873 return 0;
876} 874}
877 875
878static void nl_fib_lookup_exit(struct net *net) 876static void nl_fib_lookup_exit(struct net *net)
879{ 877{
880 /* At the last minute lie and say this is a socket for the
881 * initial network namespace. So the socket will be safe to free.
882 */
883 net->ipv4.fibnl->sk_net = get_net(&init_net);
884 netlink_kernel_release(net->ipv4.fibnl); 878 netlink_kernel_release(net->ipv4.fibnl);
879 net->ipv4.fibnl = NULL;
885} 880}
886 881
887static void fib_disable_ip(struct net_device *dev, int force) 882static void fib_disable_ip(struct net_device *dev, int force)