Commit 38fd84e6 authored by Tom Herbert's avatar Tom Herbert Committed by Greg Kroah-Hartman

net: add skb_checksum_complete_unset

[ Upstream commit 4e18b9ad ]

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: default avatarTom Herbert <tom@herbertland.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cf5bab3a
...@@ -2998,6 +2998,18 @@ static inline bool __skb_checksum_validate_needed(struct sk_buff *skb, ...@@ -2998,6 +2998,18 @@ static inline bool __skb_checksum_validate_needed(struct sk_buff *skb,
*/ */
#define CHECKSUM_BREAK 76 #define CHECKSUM_BREAK 76
/* Unset checksum-complete
*
* Unset checksum complete can be done when packet is being modified
* (uncompressed for instance) and checksum-complete value is
* invalidated.
*/
static inline void skb_checksum_complete_unset(struct sk_buff *skb)
{
if (skb->ip_summed == CHECKSUM_COMPLETE)
skb->ip_summed = CHECKSUM_NONE;
}
/* Validate (init) checksum based on checksum complete. /* Validate (init) checksum based on checksum complete.
* *
* Return values: * Return values:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment