diff mbox series

[26/38] backports: add skb_postpush_rcsum()

Message ID 20221011230356.a46baa44bd00.Iac7dddba17673fed03773ee928383cdf59718f5f@changeid (mailing list archive)
State New, archived
Headers show
Series backports updates | expand

Commit Message

Johannes Berg Oct. 11, 2022, 9:04 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

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

Patch

diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index c5015e9def24..79cff7afd73a 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -4,6 +4,23 @@ 
 #include <linux/version.h>
 
 
+#if LINUX_VERSION_IS_LESS(4,4,10)
+static __always_inline void
+__skb_postpush_rcsum(struct sk_buff *skb, const void *start, unsigned int len,
+		     unsigned int off)
+{
+	if (skb->ip_summed == CHECKSUM_COMPLETE)
+		skb->csum = csum_block_add(skb->csum,
+					   csum_partial(start, len, 0), off);
+}
+
+static inline void skb_postpush_rcsum(struct sk_buff *skb,
+				      const void *start, unsigned int len)
+{
+	__skb_postpush_rcsum(skb, start, len, 0);
+}
+#endif /* LINUX_VERSION_IS_LESS(4,4,10) */
+
 #if LINUX_VERSION_IS_LESS(4,13,0)
 static inline void *backport_skb_put(struct sk_buff *skb, unsigned int len)
 {