Skip to content

Commit 4e4f7ce

Browse files
Ilpo Järvinendavem330
authored andcommitted
gro: prevent ACE field corruption & better AccECN handling
There are important differences in how the CWR field behaves in RFC3168 and AccECN. With AccECN, CWR flag is part of the ACE counter and its changes are important so adjust the flags changed mask accordingly. Also, if CWR is there, set the Accurate ECN GSO flag to avoid corrupting CWR flag somewhere. Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: Chia-Yu Chang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 023af5a commit 4e4f7ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/ipv4/tcp_offload.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ struct sk_buff *tcp_gro_receive(struct list_head *head, struct sk_buff *skb,
332332
th2 = tcp_hdr(p);
333333
flush = (__force int)(flags & TCP_FLAG_CWR);
334334
flush |= (__force int)((flags ^ tcp_flag_word(th2)) &
335-
~(TCP_FLAG_CWR | TCP_FLAG_FIN | TCP_FLAG_PSH));
335+
~(TCP_FLAG_FIN | TCP_FLAG_PSH));
336336
flush |= (__force int)(th->ack_seq ^ th2->ack_seq);
337337
for (i = sizeof(*th); i < thlen; i += 4)
338338
flush |= *(u32 *)((u8 *)th + i) ^
@@ -408,7 +408,7 @@ void tcp_gro_complete(struct sk_buff *skb)
408408
shinfo->gso_segs = NAPI_GRO_CB(skb)->count;
409409

410410
if (th->cwr)
411-
shinfo->gso_type |= SKB_GSO_TCP_ECN;
411+
shinfo->gso_type |= SKB_GSO_TCP_ACCECN;
412412
}
413413
EXPORT_SYMBOL(tcp_gro_complete);
414414

0 commit comments

Comments
 (0)