aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipip.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2010-02-16 04:05:04 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-16 17:55:25 -0500
commitd5aa407f59f5b83d2c50ec88f5bf56d40f1f8978 (patch)
tree664c30873708f0e361e5250835238043200f4b50 /net/ipv4/ipip.c
parentc2892f02712e9516d72841d5c019ed6916329794 (diff)
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 <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipip.c')
-rw-r--r--net/ipv4/ipip.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 95db732e542b..2f302d3ac9a3 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -830,15 +830,14 @@ static int __init ipip_init(void)
830 830
831 printk(banner); 831 printk(banner);
832 832
833 if (xfrm4_tunnel_register(&ipip_handler, AF_INET)) { 833 err = register_pernet_device(&ipip_net_ops);
834 if (err < 0)
835 return err;
836 err = xfrm4_tunnel_register(&ipip_handler, AF_INET);
837 if (err < 0) {
838 unregister_pernet_device(&ipip_net_ops);
834 printk(KERN_INFO "ipip init: can't register tunnel\n"); 839 printk(KERN_INFO "ipip init: can't register tunnel\n");
835 return -EAGAIN;
836 } 840 }
837
838 err = register_pernet_device(&ipip_net_ops);
839 if (err)
840 xfrm4_tunnel_deregister(&ipip_handler, AF_INET);
841
842 return err; 841 return err;
843} 842}
844 843