Skip to content

Commit 573ce1c

Browse files
committed
xfrm6: 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 <[email protected]>
1 parent fa9ad96 commit 573ce1c

File tree

2 files changed

+0
-71
lines changed

2 files changed

+0
-71
lines changed

include/net/xfrm.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,12 +1393,6 @@ struct xfrm_tunnel {
13931393
int priority;
13941394
};
13951395

1396-
struct xfrm_tunnel_notifier {
1397-
int (*handler)(struct sk_buff *skb);
1398-
struct xfrm_tunnel_notifier __rcu *next;
1399-
int priority;
1400-
};
1401-
14021396
struct xfrm6_tunnel {
14031397
int (*handler)(struct sk_buff *skb);
14041398
int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt,
@@ -1554,8 +1548,6 @@ int xfrm4_protocol_deregister(struct xfrm4_protocol *handler, unsigned char prot
15541548
int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family);
15551549
int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family);
15561550
void xfrm4_local_error(struct sk_buff *skb, u32 mtu);
1557-
int xfrm6_mode_tunnel_input_register(struct xfrm_tunnel_notifier *handler);
1558-
int xfrm6_mode_tunnel_input_deregister(struct xfrm_tunnel_notifier *handler);
15591551
int xfrm6_extract_header(struct sk_buff *skb);
15601552
int xfrm6_extract_input(struct xfrm_state *x, struct sk_buff *skb);
15611553
int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi);

net/ipv6/xfrm6_mode_tunnel.c

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -18,65 +18,6 @@
1818
#include <net/ipv6.h>
1919
#include <net/xfrm.h>
2020

21-
/* Informational hook. The decap is still done here. */
22-
static struct xfrm_tunnel_notifier __rcu *rcv_notify_handlers __read_mostly;
23-
static DEFINE_MUTEX(xfrm6_mode_tunnel_input_mutex);
24-
25-
int xfrm6_mode_tunnel_input_register(struct xfrm_tunnel_notifier *handler)
26-
{
27-
struct xfrm_tunnel_notifier __rcu **pprev;
28-
struct xfrm_tunnel_notifier *t;
29-
int ret = -EEXIST;
30-
int priority = handler->priority;
31-
32-
mutex_lock(&xfrm6_mode_tunnel_input_mutex);
33-
34-
for (pprev = &rcv_notify_handlers;
35-
(t = rcu_dereference_protected(*pprev,
36-
lockdep_is_held(&xfrm6_mode_tunnel_input_mutex))) != NULL;
37-
pprev = &t->next) {
38-
if (t->priority > priority)
39-
break;
40-
if (t->priority == priority)
41-
goto err;
42-
43-
}
44-
45-
handler->next = *pprev;
46-
rcu_assign_pointer(*pprev, handler);
47-
48-
ret = 0;
49-
50-
err:
51-
mutex_unlock(&xfrm6_mode_tunnel_input_mutex);
52-
return ret;
53-
}
54-
EXPORT_SYMBOL_GPL(xfrm6_mode_tunnel_input_register);
55-
56-
int xfrm6_mode_tunnel_input_deregister(struct xfrm_tunnel_notifier *handler)
57-
{
58-
struct xfrm_tunnel_notifier __rcu **pprev;
59-
struct xfrm_tunnel_notifier *t;
60-
int ret = -ENOENT;
61-
62-
mutex_lock(&xfrm6_mode_tunnel_input_mutex);
63-
for (pprev = &rcv_notify_handlers;
64-
(t = rcu_dereference_protected(*pprev,
65-
lockdep_is_held(&xfrm6_mode_tunnel_input_mutex))) != NULL;
66-
pprev = &t->next) {
67-
if (t == handler) {
68-
*pprev = handler->next;
69-
ret = 0;
70-
break;
71-
}
72-
}
73-
mutex_unlock(&xfrm6_mode_tunnel_input_mutex);
74-
synchronize_net();
75-
76-
return ret;
77-
}
78-
EXPORT_SYMBOL_GPL(xfrm6_mode_tunnel_input_deregister);
79-
8021
static inline void ipip6_ecn_decapsulate(struct sk_buff *skb)
8122
{
8223
const struct ipv6hdr *outer_iph = ipv6_hdr(skb);
@@ -130,17 +71,13 @@ static int xfrm6_mode_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
13071

13172
static int xfrm6_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
13273
{
133-
struct xfrm_tunnel_notifier *handler;
13474
int err = -EINVAL;
13575

13676
if (XFRM_MODE_SKB_CB(skb)->protocol != IPPROTO_IPV6)
13777
goto out;
13878
if (!pskb_may_pull(skb, sizeof(struct ipv6hdr)))
13979
goto out;
14080

141-
for_each_input_rcu(rcv_notify_handlers, handler)
142-
handler->handler(skb);
143-
14481
err = skb_unclone(skb, GFP_ATOMIC);
14582
if (err)
14683
goto out;

0 commit comments

Comments
 (0)