summaryrefslogtreecommitdiffhomepage
path: root/test/packetimpact/testbench/dut.go
diff options
context:
space:
mode:
authorMithun Iyer <iyerm@google.com>2020-05-29 12:27:55 -0700
committergVisor bot <gvisor-bot@google.com>2020-05-29 12:33:28 -0700
commit089c88f2e87fb14cead02caea7f9dba0a5957395 (patch)
tree7c156a7eb5457da52b244f92bcacff0a013c727d /test/packetimpact/testbench/dut.go
parentccf69bdd7e05a4e5f404fbef89a7f49f218645e2 (diff)
Move TCP to CLOSED from SYN-RCVD on RST.
RST handling is broken when the TCP state transitions from SYN-SENT to SYN-RCVD in case of simultaneous open. An incoming RST should trigger cleanup of the endpoint. RFC793, section 3.9, page 70. Fixes #2814 PiperOrigin-RevId: 313828777
Diffstat (limited to 'test/packetimpact/testbench/dut.go')
-rw-r--r--test/packetimpact/testbench/dut.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/packetimpact/testbench/dut.go b/test/packetimpact/testbench/dut.go
index b919a3c2e..f3e326adf 100644
--- a/test/packetimpact/testbench/dut.go
+++ b/test/packetimpact/testbench/dut.go
@@ -241,7 +241,9 @@ func (dut *DUT) Connect(fd int32, sa unix.Sockaddr) {
ctx, cancel := context.WithTimeout(context.Background(), RPCTimeout)
defer cancel()
ret, err := dut.ConnectWithErrno(ctx, fd, sa)
- if ret != 0 {
+ // Ignore 'operation in progress' error that can be returned when the socket
+ // is non-blocking.
+ if err != syscall.Errno(unix.EINPROGRESS) && ret != 0 {
dut.t.Fatalf("failed to connect socket: %s", err)
}
}