diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2014-02-21 02:41:10 -0500 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2014-02-25 01:04:18 -0500 |
commit | 9994bb8e1e05833e627d54147acb64952efcb713 (patch) | |
tree | 181126b2c9316385ce1cb1e3c268a2e480a89de7 | |
parent | df3893c176e9b0bb39b28ab5ec8113fa20ad1ee0 (diff) |
xfrm4: Remove xfrm_tunnel_notifier
This was used from vti and is replaced by the IPsec protocol
multiplexer hooks. It is now unused, so remove it.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
-rw-r--r-- | include/net/xfrm.h | 2 | ||||
-rw-r--r-- | net/ipv4/xfrm4_mode_tunnel.c | 68 |
2 files changed, 0 insertions, 70 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 33112599fa47..8b925288a8bc 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -1531,8 +1531,6 @@ int xfrm4_protocol_deregister(struct xfrm4_protocol *handler, unsigned char prot | |||
1531 | int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family); | 1531 | int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family); |
1532 | int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family); | 1532 | int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family); |
1533 | void xfrm4_local_error(struct sk_buff *skb, u32 mtu); | 1533 | void xfrm4_local_error(struct sk_buff *skb, u32 mtu); |
1534 | int xfrm4_mode_tunnel_input_register(struct xfrm_tunnel_notifier *handler); | ||
1535 | int xfrm4_mode_tunnel_input_deregister(struct xfrm_tunnel_notifier *handler); | ||
1536 | int xfrm6_mode_tunnel_input_register(struct xfrm_tunnel_notifier *handler); | 1534 | int xfrm6_mode_tunnel_input_register(struct xfrm_tunnel_notifier *handler); |
1537 | int xfrm6_mode_tunnel_input_deregister(struct xfrm_tunnel_notifier *handler); | 1535 | int xfrm6_mode_tunnel_input_deregister(struct xfrm_tunnel_notifier *handler); |
1538 | int xfrm6_extract_header(struct sk_buff *skb); | 1536 | int xfrm6_extract_header(struct sk_buff *skb); |
diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c index 31b18152528f..05f2b484954f 100644 --- a/net/ipv4/xfrm4_mode_tunnel.c +++ b/net/ipv4/xfrm4_mode_tunnel.c | |||
@@ -15,65 +15,6 @@ | |||
15 | #include <net/ip.h> | 15 | #include <net/ip.h> |
16 | #include <net/xfrm.h> | 16 | #include <net/xfrm.h> |
17 | 17 | ||
18 | /* Informational hook. The decap is still done here. */ | ||
19 | static struct xfrm_tunnel_notifier __rcu *rcv_notify_handlers __read_mostly; | ||
20 | static DEFINE_MUTEX(xfrm4_mode_tunnel_input_mutex); | ||
21 | |||
22 | int xfrm4_mode_tunnel_input_register(struct xfrm_tunnel_notifier *handler) | ||
23 | { | ||
24 | struct xfrm_tunnel_notifier __rcu **pprev; | ||
25 | struct xfrm_tunnel_notifier *t; | ||
26 | int ret = -EEXIST; | ||
27 | int priority = handler->priority; | ||
28 | |||
29 | mutex_lock(&xfrm4_mode_tunnel_input_mutex); | ||
30 | |||
31 | for (pprev = &rcv_notify_handlers; | ||
32 | (t = rcu_dereference_protected(*pprev, | ||
33 | lockdep_is_held(&xfrm4_mode_tunnel_input_mutex))) != NULL; | ||
34 | pprev = &t->next) { | ||
35 | if (t->priority > priority) | ||
36 | break; | ||
37 | if (t->priority == priority) | ||
38 | goto err; | ||
39 | |||
40 | } | ||
41 | |||
42 | handler->next = *pprev; | ||
43 | rcu_assign_pointer(*pprev, handler); | ||
44 | |||
45 | ret = 0; | ||
46 | |||
47 | err: | ||
48 | mutex_unlock(&xfrm4_mode_tunnel_input_mutex); | ||
49 | return ret; | ||
50 | } | ||
51 | EXPORT_SYMBOL_GPL(xfrm4_mode_tunnel_input_register); | ||
52 | |||
53 | int xfrm4_mode_tunnel_input_deregister(struct xfrm_tunnel_notifier *handler) | ||
54 | { | ||
55 | struct xfrm_tunnel_notifier __rcu **pprev; | ||
56 | struct xfrm_tunnel_notifier *t; | ||
57 | int ret = -ENOENT; | ||
58 | |||
59 | mutex_lock(&xfrm4_mode_tunnel_input_mutex); | ||
60 | for (pprev = &rcv_notify_handlers; | ||
61 | (t = rcu_dereference_protected(*pprev, | ||
62 | lockdep_is_held(&xfrm4_mode_tunnel_input_mutex))) != NULL; | ||
63 | pprev = &t->next) { | ||
64 | if (t == handler) { | ||
65 | *pprev = handler->next; | ||
66 | ret = 0; | ||
67 | break; | ||
68 | } | ||
69 | } | ||
70 | mutex_unlock(&xfrm4_mode_tunnel_input_mutex); | ||
71 | synchronize_net(); | ||
72 | |||
73 | return ret; | ||
74 | } | ||
75 | EXPORT_SYMBOL_GPL(xfrm4_mode_tunnel_input_deregister); | ||
76 | |||
77 | static inline void ipip_ecn_decapsulate(struct sk_buff *skb) | 18 | static inline void ipip_ecn_decapsulate(struct sk_buff *skb) |
78 | { | 19 | { |
79 | struct iphdr *inner_iph = ipip_hdr(skb); | 20 | struct iphdr *inner_iph = ipip_hdr(skb); |
@@ -127,14 +68,8 @@ static int xfrm4_mode_tunnel_output(struct xfrm_state *x, struct sk_buff *skb) | |||
127 | return 0; | 68 | return 0; |
128 | } | 69 | } |
129 | 70 | ||
130 | #define for_each_input_rcu(head, handler) \ | ||
131 | for (handler = rcu_dereference(head); \ | ||
132 | handler != NULL; \ | ||
133 | handler = rcu_dereference(handler->next)) | ||
134 | |||
135 | static int xfrm4_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb) | 71 | static int xfrm4_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb) |
136 | { | 72 | { |
137 | struct xfrm_tunnel_notifier *handler; | ||
138 | int err = -EINVAL; | 73 | int err = -EINVAL; |
139 | 74 | ||
140 | if (XFRM_MODE_SKB_CB(skb)->protocol != IPPROTO_IPIP) | 75 | if (XFRM_MODE_SKB_CB(skb)->protocol != IPPROTO_IPIP) |
@@ -143,9 +78,6 @@ static int xfrm4_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb) | |||
143 | if (!pskb_may_pull(skb, sizeof(struct iphdr))) | 78 | if (!pskb_may_pull(skb, sizeof(struct iphdr))) |
144 | goto out; | 79 | goto out; |
145 | 80 | ||
146 | for_each_input_rcu(rcv_notify_handlers, handler) | ||
147 | handler->handler(skb); | ||
148 | |||
149 | err = skb_unclone(skb, GFP_ATOMIC); | 81 | err = skb_unclone(skb, GFP_ATOMIC); |
150 | if (err) | 82 | if (err) |
151 | goto out; | 83 | goto out; |