Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311353
b: refs/heads/master
c: 2a0c451
h: refs/heads/master
i:
  311351: 2716c2c
v: v3
  • Loading branch information
Thomas Graf authored and David S. Miller committed Jun 15, 2012
1 parent 70dda9e commit b3b3d3d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0f6efff92524c65fc3ef41c8b936c526580f1db0
refs/heads/master: 2a0c451ade8e1783c5d453948289e4a978d417c9
2 changes: 2 additions & 0 deletions trunk/include/net/ip6_fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ extern void fib6_run_gc(unsigned long expires,
extern void fib6_gc_cleanup(void);

extern int fib6_init(void);
extern int fib6_init_late(void);
extern void fib6_cleanup_late(void);

#ifdef CONFIG_IPV6_MULTIPLE_TABLES
extern int fib6_rules_init(void);
Expand Down
18 changes: 11 additions & 7 deletions trunk/net/ipv6/ip6_fib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1692,21 +1692,25 @@ 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);
Expand Down
16 changes: 11 additions & 5 deletions trunk/net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -3018,10 +3018,14 @@ int __init ip6_route_init(void)
if (ret)
goto out_kmem_cache;

ret = register_pernet_subsys(&ip6_route_net_ops);
ret = fib6_init();
if (ret)
goto out_dst_entries;

ret = register_pernet_subsys(&ip6_route_net_ops);
if (ret)
goto out_fib6_init;

ip6_dst_blackhole_ops.kmem_cachep = ip6_dst_ops_template.kmem_cachep;

/* Registering of the loopback is done before this portion of code,
Expand All @@ -3035,13 +3039,13 @@ int __init ip6_route_init(void)
init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
#endif
ret = fib6_init();
ret = fib6_init_late();
if (ret)
goto out_register_subsys;

ret = xfrm6_init();
if (ret)
goto out_fib6_init;
goto out_fib6_init_late;

ret = fib6_rules_init();
if (ret)
Expand All @@ -3064,10 +3068,12 @@ int __init ip6_route_init(void)
fib6_rules_cleanup();
xfrm6_init:
xfrm6_fini();
out_fib6_init:
fib6_gc_cleanup();
out_fib6_init_late:
fib6_cleanup_late();
out_register_subsys:
unregister_pernet_subsys(&ip6_route_net_ops);
out_fib6_init:
fib6_gc_cleanup();
out_dst_entries:
dst_entries_destroy(&ip6_dst_blackhole_ops);
out_kmem_cache:
Expand Down

0 comments on commit b3b3d3d

Please sign in to comment.