Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: add skb_checksum_complete_unset

This function changes ip_summed to CHECKSUM_NONE if CHECKSUM_COMPLETE
is set. This is called to discard checksum-complete when packet
is being modified and checksum is not pulled for headers in a layer.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Tom Herbert and committed by
David S. Miller
4e18b9ad a068833b

+12
+12
include/linux/skbuff.h
··· 3016 3016 */ 3017 3017 #define CHECKSUM_BREAK 76 3018 3018 3019 + /* Unset checksum-complete 3020 + * 3021 + * Unset checksum complete can be done when packet is being modified 3022 + * (uncompressed for instance) and checksum-complete value is 3023 + * invalidated. 3024 + */ 3025 + static inline void skb_checksum_complete_unset(struct sk_buff *skb) 3026 + { 3027 + if (skb->ip_summed == CHECKSUM_COMPLETE) 3028 + skb->ip_summed = CHECKSUM_NONE; 3029 + } 3030 + 3019 3031 /* Validate (init) checksum based on checksum complete. 3020 3032 * 3021 3033 * Return values: