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

Johannes Berg <[email protected]> Fri, 24 May 2024 19:07:43 +0200
Newsgroups org.kernel.vger.backports
Message-ID <20240524190907.ca531b72b1df.Ibba0f29bbf9e340a7b04d26c2e99f596233e6e89@changeid>
From: Gregory Greenman <[email protected]>

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

Signed-off-by: Gregory Greenman <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
---
 backport/backport-include/linux/skbuff.h | 7 +++++++
 1 file changed, 7 insertions(+)

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 */
-- 
2.45.1