aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/ip6_fib.c18
-rw-r--r--net/ipv6/route.c16
2 files changed, 12 insertions, 22 deletions
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index fbd4afff05fa..74c21b924a79 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -1692,25 +1692,21 @@ int __init fib6_init(void)
1692 ret = register_pernet_subsys(&fib6_net_ops); 1692 ret = register_pernet_subsys(&fib6_net_ops);
1693 if (ret) 1693 if (ret)
1694 goto out_kmem_cache_create; 1694 goto out_kmem_cache_create;
1695
1696 ret = __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib,
1697 NULL);
1698 if (ret)
1699 goto out_unregister_subsys;
1695out: 1700out:
1696 return ret; 1701 return ret;
1697 1702
1703out_unregister_subsys:
1704 unregister_pernet_subsys(&fib6_net_ops);
1698out_kmem_cache_create: 1705out_kmem_cache_create:
1699 kmem_cache_destroy(fib6_node_kmem); 1706 kmem_cache_destroy(fib6_node_kmem);
1700 goto out; 1707 goto out;
1701} 1708}
1702 1709
1703int __init fib6_init_late(void)
1704{
1705 return __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib,
1706 NULL);
1707}
1708
1709void fib6_cleanup_late(void)
1710{
1711 rtnl_unregister(PF_INET6, RTM_GETROUTE);
1712}
1713
1714void fib6_gc_cleanup(void) 1710void fib6_gc_cleanup(void)
1715{ 1711{
1716 unregister_pernet_subsys(&fib6_net_ops); 1712 unregister_pernet_subsys(&fib6_net_ops);
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index dc60bf585966..999a982ad3fd 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -3018,13 +3018,9 @@ int __init ip6_route_init(void)
3018 if (ret) 3018 if (ret)
3019 goto out_kmem_cache; 3019 goto out_kmem_cache;
3020 3020
3021 ret = fib6_init();
3022 if (ret)
3023 goto out_dst_entries;
3024
3025 ret = register_pernet_subsys(&ip6_route_net_ops); 3021 ret = register_pernet_subsys(&ip6_route_net_ops);
3026 if (ret) 3022 if (ret)
3027 goto out_fib6_init; 3023 goto out_dst_entries;
3028 3024
3029 ip6_dst_blackhole_ops.kmem_cachep = ip6_dst_ops_template.kmem_cachep; 3025 ip6_dst_blackhole_ops.kmem_cachep = ip6_dst_ops_template.kmem_cachep;
3030 3026
@@ -3039,13 +3035,13 @@ int __init ip6_route_init(void)
3039 init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; 3035 init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
3040 init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); 3036 init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
3041 #endif 3037 #endif
3042 ret = fib6_init_late(); 3038 ret = fib6_init();
3043 if (ret) 3039 if (ret)
3044 goto out_register_subsys; 3040 goto out_register_subsys;
3045 3041
3046 ret = xfrm6_init(); 3042 ret = xfrm6_init();
3047 if (ret) 3043 if (ret)
3048 goto out_fib6_init_late; 3044 goto out_fib6_init;
3049 3045
3050 ret = fib6_rules_init(); 3046 ret = fib6_rules_init();
3051 if (ret) 3047 if (ret)
@@ -3068,12 +3064,10 @@ fib6_rules_init:
3068 fib6_rules_cleanup(); 3064 fib6_rules_cleanup();
3069xfrm6_init: 3065xfrm6_init:
3070 xfrm6_fini(); 3066 xfrm6_fini();
3071out_fib6_init_late:
3072 fib6_cleanup_late();
3073out_register_subsys:
3074 unregister_pernet_subsys(&ip6_route_net_ops);
3075out_fib6_init: 3067out_fib6_init:
3076 fib6_gc_cleanup(); 3068 fib6_gc_cleanup();
3069out_register_subsys:
3070 unregister_pernet_subsys(&ip6_route_net_ops);
3077out_dst_entries: 3071out_dst_entries:
3078 dst_entries_destroy(&ip6_dst_blackhole_ops); 3072 dst_entries_destroy(&ip6_dst_blackhole_ops);
3079out_kmem_cache: 3073out_kmem_cache: