mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
tunnels: fix netns vs proto registration ordering
Same stuff as in ip_gre patch: receive hook can be called before netns setup is done, oopsing in net_generic(). Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
c2892f0271
commit
d5aa407f59
4 changed files with 47 additions and 62 deletions
|
|
@ -830,15 +830,14 @@ static int __init ipip_init(void)
|
|||
|
||||
printk(banner);
|
||||
|
||||
if (xfrm4_tunnel_register(&ipip_handler, AF_INET)) {
|
||||
printk(KERN_INFO "ipip init: can't register tunnel\n");
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
err = register_pernet_device(&ipip_net_ops);
|
||||
if (err)
|
||||
xfrm4_tunnel_deregister(&ipip_handler, AF_INET);
|
||||
|
||||
if (err < 0)
|
||||
return err;
|
||||
err = xfrm4_tunnel_register(&ipip_handler, AF_INET);
|
||||
if (err < 0) {
|
||||
unregister_pernet_device(&ipip_net_ops);
|
||||
printk(KERN_INFO "ipip init: can't register tunnel\n");
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue