[PATCH 26/38] backports: add skb_postpush_rcsum()
Johannes Berg <[email protected]> Tue, 11 Oct 2022 23:04:34 +0200
| Newsgroups | org.kernel.vger.backports |
|---|---|
| Message-ID | <20221011230356.a46baa44bd00.Iac7dddba17673fed03773ee928383cdf59718f5f@changeid> |
From: Johannes Berg <[email protected]> Signed-off-by: Johannes Berg <[email protected]> --- backport/backport-include/linux/skbuff.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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) { -- 2.37.3 -- To unsubscribe from this list: send the line "unsubscribe backports" in