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.
Unified · Split
| @@ -111,7 +111,9 @@ struct sk_buff; · 110 unmodified lines | |||
| 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) |