summaryrefslogtreecommitdiff
path: root/net/ipv6/ip6_fib.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-06-16 01:12:19 -0700
committerDavid S. Miller <davem@davemloft.net>2012-06-16 01:12:19 -0700
commite8803b6c387129059e04d9e14d49efda250a7361 (patch)
tree147fe0ff12046cabcb3a4c39d07a751b79707ddb /net/ipv6/ip6_fib.c
parent2a0c451ade8e1783c5d453948289e4a978d417c9 (diff)
Revert "ipv6: Prevent access to uninitialized fib_table_hash via /proc/net/ipv6_route"
This reverts commit 2a0c451ade8e1783c5d453948289e4a978d417c9. It causes crashes, because now ip6_null_entry is used before it is initialized. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_fib.c')
-rw-r--r--net/ipv6/ip6_fib.c18
1 files changed, 7 insertions, 11 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)
ret = register_pernet_subsys(&fib6_net_ops);
if (ret)
goto out_kmem_cache_create;
+
+ ret = __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib,
+ NULL);
+ if (ret)
+ goto out_unregister_subsys;
out:
return ret;
+out_unregister_subsys:
+ unregister_pernet_subsys(&fib6_net_ops);
out_kmem_cache_create:
kmem_cache_destroy(fib6_node_kmem);
goto out;
}
-int __init fib6_init_late(void)
-{
- return __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib,
- NULL);
-}
-
-void fib6_cleanup_late(void)
-{
- rtnl_unregister(PF_INET6, RTM_GETROUTE);
-}
-
void fib6_gc_cleanup(void)
{
unregister_pernet_subsys(&fib6_net_ops);