mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
netns xfrm: fixup xfrm6_tunnel error propagation
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ce96bc86bf
commit
e924960dac
1 changed files with 11 additions and 5 deletions
|
@ -353,13 +353,19 @@ static struct xfrm6_tunnel xfrm46_tunnel_handler = {
|
||||||
|
|
||||||
static int __init xfrm6_tunnel_init(void)
|
static int __init xfrm6_tunnel_init(void)
|
||||||
{
|
{
|
||||||
if (xfrm_register_type(&xfrm6_tunnel_type, AF_INET6) < 0)
|
int rv;
|
||||||
|
|
||||||
|
rv = xfrm_register_type(&xfrm6_tunnel_type, AF_INET6);
|
||||||
|
if (rv < 0)
|
||||||
goto err;
|
goto err;
|
||||||
if (xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6))
|
rv = xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6);
|
||||||
|
if (rv < 0)
|
||||||
goto unreg;
|
goto unreg;
|
||||||
if (xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET))
|
rv = xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET);
|
||||||
|
if (rv < 0)
|
||||||
goto dereg6;
|
goto dereg6;
|
||||||
if (xfrm6_tunnel_spi_init() < 0)
|
rv = xfrm6_tunnel_spi_init();
|
||||||
|
if (rv < 0)
|
||||||
goto dereg46;
|
goto dereg46;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -370,7 +376,7 @@ static int __init xfrm6_tunnel_init(void)
|
||||||
unreg:
|
unreg:
|
||||||
xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
|
xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
|
||||||
err:
|
err:
|
||||||
return -EAGAIN;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __exit xfrm6_tunnel_fini(void)
|
static void __exit xfrm6_tunnel_fini(void)
|
||||||
|
|
Loading…
Reference in a new issue