summary refs log tree commit diff
path: root/include/net/xfrm.h
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2020-07-06 20:01:30 +0800
committerSteffen Klassert <steffen.klassert@secunet.com>2020-07-09 12:51:36 +0200
commit6df2db5d37ba3df8c80d90c15f1e20480be43f75 (patch)
treec3e7531b03e68b1033ad9194332c8077c829003f /include/net/xfrm.h
parent1475ee0ac9a16dd5df23ca8abe1039eb6086eb66 (diff)
downloadlinux-6df2db5d37ba3df8c80d90c15f1e20480be43f75.tar.gz
tunnel4: add cb_handler to struct xfrm_tunnel
This patch is to register a callback function tunnel4_rcv_cb with
is_ipip set in a xfrm_input_afinfo object for tunnel4 and tunnel64.

It will be called by xfrm_rcv_cb() from xfrm_input() when family
is AF_INET and proto is IPPROTO_IPIP or IPPROTO_IPV6.

v1->v2:
  - Fix a sparse warning caused by the missing "__rcu", as Jakub
    noticed.
  - Handle the err returned by xfrm_input_register_afinfo() in
    tunnel4_init/fini(), as Sabrina noticed.
v2->v3:
  - Add "#if IS_ENABLED(CONFIG_INET_XFRM_TUNNEL)" to fix the build error
    when xfrm is disabled, reported by kbuild test robot.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r--include/net/xfrm.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 4666bc9e59ab..c1ec6294d773 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1416,6 +1416,7 @@ struct xfrm6_protocol {
 /* XFRM tunnel handlers.  */
 struct xfrm_tunnel {
 	int (*handler)(struct sk_buff *skb);
+	int (*cb_handler)(struct sk_buff *skb, int err);
 	int (*err_handler)(struct sk_buff *skb, u32 info);
 
 	struct xfrm_tunnel __rcu *next;