aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/xfrm6_tunnel.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/xfrm6_tunnel.c')
-rw-r--r--net/ipv6/xfrm6_tunnel.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c
index c2b278138604..80193db224d9 100644
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -345,24 +345,23 @@ static struct xfrm6_tunnel xfrm46_tunnel_handler = {
345static int __init xfrm6_tunnel_init(void) 345static int __init xfrm6_tunnel_init(void)
346{ 346{
347 if (xfrm_register_type(&xfrm6_tunnel_type, AF_INET6) < 0) 347 if (xfrm_register_type(&xfrm6_tunnel_type, AF_INET6) < 0)
348 return -EAGAIN; 348 goto err;
349 349 if (xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6))
350 if (xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6)) { 350 goto unreg;
351 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); 351 if (xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET))
352 return -EAGAIN; 352 goto dereg6;
353 } 353 if (xfrm6_tunnel_spi_init() < 0)
354 if (xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET)) { 354 goto dereg46;
355 xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
356 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
357 return -EAGAIN;
358 }
359 if (xfrm6_tunnel_spi_init() < 0) {
360 xfrm6_tunnel_deregister(&xfrm46_tunnel_handler, AF_INET);
361 xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
362 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
363 return -EAGAIN;
364 }
365 return 0; 355 return 0;
356
357dereg46:
358 xfrm6_tunnel_deregister(&xfrm46_tunnel_handler, AF_INET);
359dereg6:
360 xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
361unreg:
362 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
363err:
364 return -EAGAIN;
366} 365}
367 366
368static void __exit xfrm6_tunnel_fini(void) 367static void __exit xfrm6_tunnel_fini(void)