Skip to content

Commit bbdff22

Browse files
Tom Herbertdavem330
Tom Herbert
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 46fb51e commit bbdff22

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/net/udp.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ struct sk_buff;
111111
*/
112112
static inline __sum16 __udp_lib_checksum_complete(struct sk_buff *skb)
113113
{
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));
115117
}
116118

117119
static inline int udp_lib_checksum_complete(struct sk_buff *skb)

0 commit comments

Comments
 (0)