All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/4] udp: call __skb_checksum_complete when doing full checksum
@ 2014-06-12 23:04 Tom Herbert
  0 siblings, 0 replies; only message in thread
From: Tom Herbert @ 2014-06-12 23:04 UTC (permalink / raw)
  To: davem, netdev

In __udp_lib_checksum_complete check if checksum is being done over all
the data (len is equal to skb->len) and if it is call
__skb_checksum_complete instead of __skb_checksum_complete_head. This
allows checksum to be saved in checksum complete.

Signed-off-by: Tom Herbert <therbert@google.com>
---
 include/net/udp.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/net/udp.h b/include/net/udp.h
index 2ecfc6e..68a1fef 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -111,7 +111,9 @@ struct sk_buff;
  */
 static inline __sum16 __udp_lib_checksum_complete(struct sk_buff *skb)
 {
-	return __skb_checksum_complete_head(skb, UDP_SKB_CB(skb)->cscov);
+	return (UDP_SKB_CB(skb)->cscov == skb->len ?
+		__skb_checksum_complete(skb) :
+		__skb_checksum_complete_head(skb, UDP_SKB_CB(skb)->cscov));
 }
 
 static inline int udp_lib_checksum_complete(struct sk_buff *skb)
-- 
2.0.0.526.g5318336

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-06-12 23:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-12 23:04 [PATCH 2/4] udp: call __skb_checksum_complete when doing full checksum Tom Herbert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.