Skip to content

Commit 8d63bee

Browse files
wdebruijdavem330
authored andcommitted
net: avoid skb_warn_bad_offload false positives on UFO
skb_warn_bad_offload triggers a warning when an skb enters the GSO stack at __skb_gso_segment that does not have CHECKSUM_PARTIAL checksum offload set. Commit b2504a5 ("net: reduce skb_warn_bad_offload() noise") observed that SKB_GSO_DODGY producers can trigger the check and that passing those packets through the GSO handlers will fix it up. But, the software UFO handler will set ip_summed to CHECKSUM_NONE. When __skb_gso_segment is called from the receive path, this triggers the warning again. Make UFO set CHECKSUM_UNNECESSARY instead of CHECKSUM_NONE. On Tx these two are equivalent. On Rx, this better matches the skb state (checksum computed), as CHECKSUM_NONE here means no checksum computed. See also this thread for context: http://patchwork.ozlabs.org/patch/799015/ Fixes: b2504a5 ("net: reduce skb_warn_bad_offload() noise") Signed-off-by: Willem de Bruijn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bbae08e commit 8d63bee

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

net/core/dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2739,7 +2739,7 @@ static inline bool skb_needs_check(struct sk_buff *skb, bool tx_path)
27392739
{
27402740
if (tx_path)
27412741
return skb->ip_summed != CHECKSUM_PARTIAL &&
2742-
skb->ip_summed != CHECKSUM_NONE;
2742+
skb->ip_summed != CHECKSUM_UNNECESSARY;
27432743

27442744
return skb->ip_summed == CHECKSUM_NONE;
27452745
}

net/ipv4/udp_offload.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ static struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb,
235235
if (uh->check == 0)
236236
uh->check = CSUM_MANGLED_0;
237237

238-
skb->ip_summed = CHECKSUM_NONE;
238+
skb->ip_summed = CHECKSUM_UNNECESSARY;
239239

240240
/* If there is no outer header we can fake a checksum offload
241241
* due to the fact that we have already done the checksum in

net/ipv6/udp_offload.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb,
7272
if (uh->check == 0)
7373
uh->check = CSUM_MANGLED_0;
7474

75-
skb->ip_summed = CHECKSUM_NONE;
75+
skb->ip_summed = CHECKSUM_UNNECESSARY;
7676

7777
/* If there is no outer header we can fake a checksum offload
7878
* due to the fact that we have already done the checksum in

0 commit comments

Comments
 (0)