[PATCH 47/75] headers: Handle skb_recv_datagram() signature change.

Hauke Mehrtens <[email protected]> Fri, 28 Jun 2024 01:47:33 +0200
Newsgroups org.kernel.vger.backports
Message-ID <[email protected]>
Older kernel versions have an separate boolean option for the
MSG_DONTWAIT flag. Adapt drivers using the old code.

Signed-off-by: Hauke Mehrtens <[email protected]>
---
 backport/backport-include/linux/skbuff.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index d407752f..b40d25c5 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -80,4 +80,12 @@ static inline u64 skb_get_kcov_handle(struct sk_buff *skb)
 #define napi_build_skb build_skb
 #endif
 
+#if LINUX_VERSION_IS_LESS(5,18,6)
+static inline struct sk_buff *LINUX_BACKPORT(skb_recv_datagram)(struct sock *sk, unsigned int flags, int *err)
+{
+	return skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, flags & MSG_DONTWAIT, err);
+}
+#define skb_recv_datagram LINUX_BACKPORT(skb_recv_datagram)
+#endif /* < 5.17 */
+
 #endif /* __BACKPORT_SKBUFF_H */
-- 
2.45.2