diff options
author | Adin Scannell <ascannell@google.com> | 2021-01-12 12:36:17 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-01-12 12:38:22 -0800 |
commit | 4e03e87547853523d4ff941935a6ef1712518c61 (patch) | |
tree | e930ce0e5f15f7041e7b74daca05acc7afbd2558 /pkg/tcpip/transport/tcp | |
parent | a20da708291e2e5bdece5176dce61c1b4b10b7d9 (diff) |
Fix simple mistakes identified by goreportcard.
These are primarily simplification and lint mistakes. However, minor
fixes are also included and tests added where appropriate.
PiperOrigin-RevId: 351425971
Diffstat (limited to 'pkg/tcpip/transport/tcp')
-rw-r--r-- | pkg/tcpip/transport/tcp/tcp_test.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/pkg/tcpip/transport/tcp/tcp_test.go b/pkg/tcpip/transport/tcp/tcp_test.go index 9fa4672d7..aeceee7e0 100644 --- a/pkg/tcpip/transport/tcp/tcp_test.go +++ b/pkg/tcpip/transport/tcp/tcp_test.go @@ -3461,7 +3461,7 @@ func TestRetransmitIPv4IDUniqueness(t *testing.T) { checker.TCPFlagsMatch(header.TCPFlagAck, ^uint8(header.TCPFlagPsh)), ), ) - idSet := map[uint16]struct{}{header.IPv4(pkt).ID(): struct{}{}} + idSet := map[uint16]struct{}{header.IPv4(pkt).ID(): {}} // Expect two retransmitted packets, and that all packets received have // unique IPv4 ID values. for i := 0; i <= 2; i++ { @@ -5698,16 +5698,14 @@ func TestListenBacklogFullSynCookieInUse(t *testing.T) { t.Fatalf("Bind failed: %s", err) } - // Test acceptance. // Start listening. listenBacklog := 1 - portOffset := uint16(0) if err := c.EP.Listen(listenBacklog); err != nil { t.Fatalf("Listen failed: %s", err) } - executeHandshake(t, c, context.TestPort+portOffset, false) - portOffset++ + executeHandshake(t, c, context.TestPort, false) + // Wait for this to be delivered to the accept queue. time.Sleep(50 * time.Millisecond) |