summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux
diff options
context:
space:
mode:
authorNayana Bidari <nybidari@google.com>2021-01-29 13:13:46 -0800
committergVisor bot <gvisor-bot@google.com>2021-01-29 13:15:57 -0800
commit0a52b647945e557c446b173309644458cd0a2ec3 (patch)
tree0623bc78b3bd48a0df62e8821a1578c1ca08c0b2 /test/syscalls/linux
parent0fa534f1164f2bf6cf50a37d4dce584b6fc8ec07 (diff)
- Add more comments for the TCP_INFO struct fields.
PiperOrigin-RevId: 354595623
Diffstat (limited to 'test/syscalls/linux')
-rw-r--r--test/syscalls/linux/socket_ip_tcp_generic.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/syscalls/linux/socket_ip_tcp_generic.cc b/test/syscalls/linux/socket_ip_tcp_generic.cc
index a73987a7e..2c8e5f6f3 100644
--- a/test/syscalls/linux/socket_ip_tcp_generic.cc
+++ b/test/syscalls/linux/socket_ip_tcp_generic.cc
@@ -65,6 +65,9 @@ TEST_P(TCPSocketPairTest, ZeroTcpInfoSucceeds) {
SyscallSucceeds());
}
+// Copied from include/net/tcp.h.
+constexpr int TCP_CA_OPEN = 0;
+
TEST_P(TCPSocketPairTest, CheckTcpInfoFields) {
auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair());
@@ -87,7 +90,7 @@ TEST_P(TCPSocketPairTest, CheckTcpInfoFields) {
SyscallSucceeds());
// Validates the received tcp_info fields.
- EXPECT_EQ(opt.tcpi_ca_state, 0);
+ EXPECT_EQ(opt.tcpi_ca_state, TCP_CA_OPEN);
EXPECT_GT(opt.tcpi_snd_cwnd, 0);
EXPECT_GT(opt.tcpi_rto, 0);
}