summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Herbert <tom@herbertland.com>2015-04-20 14:10:04 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-06 22:03:33 +0200
commit8a6846e3226bb475db9686590da85bcc609c75a9 (patch)
tree3d67cb19fc57315e9115790c63c9b087d98f3686 /include
parent7bebf970047f59c16ddd5660b54562c8bcd40074 (diff)
downloadlinux-exynos-8a6846e3226bb475db9686590da85bcc609c75a9.tar.gz
linux-exynos-8a6846e3226bb475db9686590da85bcc609c75a9.tar.bz2
linux-exynos-8a6846e3226bb475db9686590da85bcc609c75a9.zip
net: add skb_checksum_complete_unset
[ Upstream commit 4e18b9adf2f910ec4d30b811a74a5b626e6c6125 ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/skbuff.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index f54d6659713a..b5c204c84624 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3013,6 +3013,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: