aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/ip6_fib.h2
-rw-r--r--net/ipv6/ip6_fib.c18
-rw-r--r--net/ipv6/route.c16
3 files changed, 12 insertions, 24 deletions
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 7fdbad522543..a192f7807659 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -302,8 +302,6 @@ extern void fib6_run_gc(unsigned long expires,
302extern void fib6_gc_cleanup(void); 302extern void fib6_gc_cleanup(void);
303 303
304extern int fib6_init(void); 304extern int fib6_init(void);
305extern int fib6_init_late(void);
306extern void fib6_cleanup_late(void);
307 305
308#ifdef CONFIG_IPV6_MULTIPLE_TABLES 306#ifdef CONFIG_IPV6_MULTIPLE_TABLES
309extern int fib6_rules_init(void); 307extern int fib6_rules_init(void);
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index a83bf067bdc5..215afc74d8aa 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -1697,25 +1697,21 @@ int __init fib6_init(void)
1697 ret = register_pernet_subsys(&fib6_net_ops); 1697 ret = register_pernet_subsys(&fib6_net_ops);
1698 if (ret) 1698 if (ret)
1699 goto out_kmem_cache_create; 1699 goto out_kmem_cache_create;
1700
1701 ret = __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib,
1702 NULL);
1703 if (ret)
1704 goto out_unregister_subsys;
1700out: 1705out:
1701 return ret; 1706 return ret;
1702 1707
1708out_unregister_subsys:
1709 unregister_pernet_subsys(&fib6_net_ops);
1703out_kmem_cache_create: 1710out_kmem_cache_create:
1704 kmem_cache_destroy(fib6_node_kmem); 1711 kmem_cache_destroy(fib6_node_kmem);
1705 goto out; 1712 goto out;
1706} 1713}
1707 1714
1708int __init fib6_init_late(void)
1709{
1710 return __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib,
1711 NULL);
1712}
1713
1714void fib6_cleanup_late(void)
1715{
1716 rtnl_unregister(PF_INET6, RTM_GETROUTE);
1717}
1718
1719void fib6_gc_cleanup(void) 1715void fib6_gc_cleanup(void)
1720{ 1716{
1721 unregister_pernet_subsys(&fib6_net_ops); 1717 unregister_pernet_subsys(&fib6_net_ops);
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 1c279fe2c9b4..e649cd78c15f 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2974,13 +2974,9 @@ int __init ip6_route_init(void)
2974 if (ret) 2974 if (ret)
2975 goto out_kmem_cache; 2975 goto out_kmem_cache;
2976 2976
2977 ret = fib6_init();
2978 if (ret)
2979 goto out_dst_entries;
2980
2981 ret = register_pernet_subsys(&ipv6_inetpeer_ops); 2977 ret = register_pernet_subsys(&ipv6_inetpeer_ops);
2982 if (ret) 2978 if (ret)
2983 goto out_fib6_init; 2979 goto out_dst_entries;
2984 2980
2985 ret = register_pernet_subsys(&ip6_route_net_ops); 2981 ret = register_pernet_subsys(&ip6_route_net_ops);
2986 if (ret) 2982 if (ret)
@@ -2999,13 +2995,13 @@ int __init ip6_route_init(void)
2999 init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; 2995 init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
3000 init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); 2996 init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
3001 #endif 2997 #endif
3002 ret = fib6_init_late(); 2998 ret = fib6_init();
3003 if (ret) 2999 if (ret)
3004 goto out_register_subsys; 3000 goto out_register_subsys;
3005 3001
3006 ret = xfrm6_init(); 3002 ret = xfrm6_init();
3007 if (ret) 3003 if (ret)
3008 goto out_fib6_init_late; 3004 goto out_fib6_init;
3009 3005
3010 ret = fib6_rules_init(); 3006 ret = fib6_rules_init();
3011 if (ret) 3007 if (ret)
@@ -3028,14 +3024,12 @@ fib6_rules_init:
3028 fib6_rules_cleanup(); 3024 fib6_rules_cleanup();
3029xfrm6_init: 3025xfrm6_init:
3030 xfrm6_fini(); 3026 xfrm6_fini();
3031out_fib6_init_late: 3027out_fib6_init:
3032 fib6_cleanup_late(); 3028 fib6_gc_cleanup();
3033out_register_subsys: 3029out_register_subsys:
3034 unregister_pernet_subsys(&ip6_route_net_ops); 3030 unregister_pernet_subsys(&ip6_route_net_ops);
3035out_register_inetpeer: 3031out_register_inetpeer:
3036 unregister_pernet_subsys(&ipv6_inetpeer_ops); 3032 unregister_pernet_subsys(&ipv6_inetpeer_ops);
3037out_fib6_init:
3038 fib6_gc_cleanup();
3039out_dst_entries: 3033out_dst_entries:
3040 dst_entries_destroy(&ip6_dst_blackhole_ops); 3034 dst_entries_destroy(&ip6_dst_blackhole_ops);
3041out_kmem_cache: 3035out_kmem_cache: