-
Notifications
You must be signed in to change notification settings - Fork 2
/
2.6.32.44.46.netns-xfrm-fixup-xfrm6_tunnel-error-propagation.patch
52 lines (44 loc) · 1.47 KB
/
2.6.32.44.46.netns-xfrm-fixup-xfrm6_tunnel-error-propagation.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From e924960dacdf85d118a98c7262edf2f99c3015cf Mon Sep 17 00:00:00 2001
From: Alexey Dobriyan <[email protected]>
Date: Mon, 25 Jan 2010 10:28:21 +0000
Subject: netns xfrm: fixup xfrm6_tunnel error propagation
From: Alexey Dobriyan <[email protected]>
commit e924960dacdf85d118a98c7262edf2f99c3015cf upstream.
Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/ipv6/xfrm6_tunnel.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -344,13 +344,19 @@ static struct xfrm6_tunnel xfrm46_tunnel
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;
- if (xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6))
+ rv = xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6);
+ if (rv < 0)
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;
- if (xfrm6_tunnel_spi_init() < 0)
+ rv = xfrm6_tunnel_spi_init();
+ if (rv < 0)
goto dereg46;
return 0;
@@ -361,7 +367,7 @@ dereg6:
unreg:
xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
err:
- return -EAGAIN;
+ return rv;
}
static void __exit xfrm6_tunnel_fini(void)