From: Tom Herbert <tom@herbertland.com>
To: <netdev@vger.kernel.org>
Subject: [PATCH net-next 1/2] net: add skb_checksum_complete_unset
Date: Mon, 20 Apr 2015 14:10:04 -0700 [thread overview]
Message-ID: <1429564205-1661247-2-git-send-email-tom@herbertland.com> (raw)
In-Reply-To: <1429564205-1661247-1-git-send-email-tom@herbertland.com>
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>
---
include/linux/skbuff.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 0991259..06793b5 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3016,6 +3016,18 @@ static inline bool __skb_checksum_validate_needed(struct sk_buff *skb,
*/
#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.
*
* Return values:
--
1.8.1
next prev parent reply other threads:[~2015-04-20 21:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-20 21:10 [PATCH net-next 0/2] net: Fix "hw csum failure" message flood for ppp tunnel Tom Herbert
2015-04-20 21:10 ` Tom Herbert [this message]
2015-04-20 21:10 ` [PATCH net-next 2/2] ppp: call skb_checksum_complete_unset in ppp_receive_frame Tom Herbert
2015-04-21 2:01 ` [PATCH net-next 0/2] net: Fix "hw csum failure" message flood for ppp tunnel David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1429564205-1661247-2-git-send-email-tom@herbertland.com \
--to=tom@herbertland.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).