Skip to content

Commit 7c532f2

Browse files
nbd168gregkh
authored andcommitted
net: fix segmentation after TCP/UDP fraglist GRO
[ Upstream commit 9f735b6 ] Since "net: gro: use cb instead of skb->network_header", the skb network header is no longer set in the GRO path. This breaks fraglist segmentation, which relies on ip_hdr()/tcp_hdr() to check for address/port changes. Fix this regression by selectively setting the network header for merged segment skbs. Fixes: 186b1ea ("net: gro: use cb instead of skb->network_header") Signed-off-by: Felix Fietkau <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 7929d27 commit 7c532f2

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

net/ipv4/tcp_offload.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ struct sk_buff *tcp_gro_receive(struct list_head *head, struct sk_buff *skb,
355355
flush |= skb->ip_summed != p->ip_summed;
356356
flush |= skb->csum_level != p->csum_level;
357357
flush |= NAPI_GRO_CB(p)->count >= 64;
358+
skb_set_network_header(skb, skb_gro_receive_network_offset(skb));
358359

359360
if (flush || skb_gro_receive_list(p, skb))
360361
mss = 1;

net/ipv4/udp_offload.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ static struct sk_buff *udp_gro_receive_segment(struct list_head *head,
604604
NAPI_GRO_CB(skb)->flush = 1;
605605
return NULL;
606606
}
607+
skb_set_network_header(skb, skb_gro_receive_network_offset(skb));
607608
ret = skb_gro_receive_list(p, skb);
608609
} else {
609610
skb_gro_postpull_rcsum(skb, uh,

0 commit comments

Comments
 (0)