Skip to content

Commit 9f735b6

Browse files
nbd168Paolo Abeni
authored andcommitted
net: fix segmentation after TCP/UDP fraglist GRO
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]>
1 parent ae3264a commit 9f735b6

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
@@ -359,6 +359,7 @@ struct sk_buff *tcp_gro_receive(struct list_head *head, struct sk_buff *skb,
359359
flush |= skb->ip_summed != p->ip_summed;
360360
flush |= skb->csum_level != p->csum_level;
361361
flush |= NAPI_GRO_CB(p)->count >= 64;
362+
skb_set_network_header(skb, skb_gro_receive_network_offset(skb));
362363

363364
if (flush || skb_gro_receive_list(p, skb))
364365
mss = 1;

net/ipv4/udp_offload.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,7 @@ static struct sk_buff *udp_gro_receive_segment(struct list_head *head,
767767
NAPI_GRO_CB(skb)->flush = 1;
768768
return NULL;
769769
}
770+
skb_set_network_header(skb, skb_gro_receive_network_offset(skb));
770771
ret = skb_gro_receive_list(p, skb);
771772
} else {
772773
skb_gro_postpull_rcsum(skb, uh,

0 commit comments

Comments
 (0)