diff options
author | Tom Herbert <therbert@google.com> | 2014-06-15 02:24:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-06-15 04:00:49 -0400 |
commit | bbdff225ede6527f91184b2a7903df8aad803ace (patch) | |
tree | e174f88e8d58e5fc8c6b5f21faa6f0b654c25709 /include/net/udp.h | |
parent | 46fb51eb96cafb2c148b7b5119adb5e31a2bf3c4 (diff) |
udp: call __skb_checksum_complete when doing full checksum
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/udp.h')
-rw-r--r-- | include/net/udp.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/net/udp.h b/include/net/udp.h index 2ecfc6e15609..68a1fefe3dfe 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -111,7 +111,9 @@ struct sk_buff; | |||
111 | */ | 111 | */ |
112 | static inline __sum16 __udp_lib_checksum_complete(struct sk_buff *skb) | 112 | static inline __sum16 __udp_lib_checksum_complete(struct sk_buff *skb) |
113 | { | 113 | { |
114 | return __skb_checksum_complete_head(skb, UDP_SKB_CB(skb)->cscov); | 114 | return (UDP_SKB_CB(skb)->cscov == skb->len ? |
115 | __skb_checksum_complete(skb) : | ||
116 | __skb_checksum_complete_head(skb, UDP_SKB_CB(skb)->cscov)); | ||
115 | } | 117 | } |
116 | 118 | ||
117 | static inline int udp_lib_checksum_complete(struct sk_buff *skb) | 119 | static inline int udp_lib_checksum_complete(struct sk_buff *skb) |