summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2019-10-09 21:23:38 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2019-10-09 23:08:52 +0200
commit5a0c323a153eebe286924771b0b8de75e9373523 (patch)
tree45d2fac361ec0a9befc7b092326e608280eaad74
parent5817d20602b7a10b4860388b71389a3b08107149 (diff)
backports: xfrm: Add skb_ext_reset()
skb_ext_reset() was added in upstream commit 174e23810cd3 ("sk_buff: drop all skb extensions on free and skb scrubbing") and is now used by mac80211_hwsim. skb_ext_reset() replaced the old call to secpath_reset() in mac80211_hwsim and other places and it also does similar things than this function. Juts call the old secpath_reset() on older kernel versions. This was added to net/xfrm.h and not linux/skbuff.h because secpath_reset() is only available in net/xfrm.h in the upstream kernel and this is not included in linux/skbuff.h. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--backport/backport-include/net/xfrm.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/backport/backport-include/net/xfrm.h b/backport/backport-include/net/xfrm.h
new file mode 100644
index 00000000..7e55984b
--- /dev/null
+++ b/backport/backport-include/net/xfrm.h
@@ -0,0 +1,14 @@
+#ifndef __BACKPORT_NET_XFRM_H
+#define __BACKPORT_NET_XFRM_H
+#include_next <net/xfrm.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(5,4,0)
+#define skb_ext_reset LINUX_BACKPORT(skb_ext_reset)
+static inline void skb_ext_reset(struct sk_buff *skb)
+{
+ secpath_reset(skb);
+}
+#endif
+
+#endif /* __BACKPORT_NET_XFRM_H */