diff mbox series

[31/74] backports: handle kfree_skb_reason for older kernels

Message ID 20240524190907.ca531b72b1df.Ibba0f29bbf9e340a7b04d26c2e99f596233e6e89@changeid (mailing list archive)
State New, archived
Headers show
Series backport updates from Intel | expand

Commit Message

Johannes Berg May 24, 2024, 5:07 p.m. UTC
From: Gregory Greenman <gregory.greenman@intel.com>

kfree_skb_reason() was added in 5.17, handle it for kernels
older than that.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/skbuff.h | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index 2daf06012864..909f0a9d63c0 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -76,4 +76,11 @@  static inline u64 skb_get_kcov_handle(struct sk_buff *skb)
 }
 #endif
 
+#if LINUX_VERSION_IS_LESS(5,17,0)
+static inline void kfree_skb_reason(struct sk_buff *skb, u32 reason)
+{
+	dev_kfree_skb(skb);
+}
+#endif
+
 #endif /* __BACKPORT_SKBUFF_H */