Skip to content

Commit

Permalink
udp: call __skb_checksum_complete when doing full checksum
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Tom Herbert authored and davem330 committed Jun 15, 2014
1 parent 46fb51e commit bbdff22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/net/udp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bbdff22

Please sign in to comment.