From febf2809e0c569d95d07cb2ca25510fe07c5813e Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Mon, 6 Jan 2025 15:47:00 +0800 Subject: [PATCH] fix GSO sending logic to respect ECN marking changes (#4835) --- connection.go | 1 + connection_test.go | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/connection.go b/connection.go index ec3a91bfe..583e9a90b 100644 --- a/connection.go +++ b/connection.go @@ -2029,6 +2029,7 @@ func (s *connection) sendPacketsWithGSO(now time.Time) error { return nil } + ecn = nextECN buf = getLargePacketBuffer() } } diff --git a/connection_test.go b/connection_test.go index b39f382eb..695fb7c61 100644 --- a/connection_test.go +++ b/connection_test.go @@ -2114,8 +2114,7 @@ func TestConnectionGSOBatchECN(t *testing.T) { done3 := make(chan struct{}) tc.sendConn.EXPECT().Write(expectedData, uint16(maxPacketSize), protocol.ECT1) - // TODO(#4829): check that the correct ECN marking is used - tc.sendConn.EXPECT().Write([]byte("foobar"), uint16(maxPacketSize), gomock.Any()).DoAndReturn( + tc.sendConn.EXPECT().Write([]byte("foobar"), uint16(maxPacketSize), protocol.ECNCE).DoAndReturn( func([]byte, uint16, protocol.ECN) error { close(done3); return nil }, )