aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/sit.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/ipv6/sit.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/ipv6/sit.c')
-rw-r--r--net/ipv6/sit.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 10207cc8cc0e..52ffd29cb93f 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1227,15 +1227,14 @@ static int __init sit_init(void)
1227 1227
1228 printk(KERN_INFO "IPv6 over IPv4 tunneling driver\n"); 1228 printk(KERN_INFO "IPv6 over IPv4 tunneling driver\n");
1229 1229
1230 if (xfrm4_tunnel_register(&sit_handler, AF_INET6) < 0) {
1231 printk(KERN_INFO "sit init: Can't add protocol\n");
1232 return -EAGAIN;
1233 }
1234
1235 err = register_pernet_device(&sit_net_ops); 1230 err = register_pernet_device(&sit_net_ops);
1236 if (err < 0) 1231 if (err < 0)
1237 xfrm4_tunnel_deregister(&sit_handler, AF_INET6); 1232 return err;
1238 1233 err = xfrm4_tunnel_register(&sit_handler, AF_INET6);
1234 if (err < 0) {
1235 unregister_pernet_device(&sit_net_ops);
1236 printk(KERN_INFO "sit init: Can't add protocol\n");
1237 }
1239 return err; 1238 return err;
1240} 1239}
1241 1240