Assert TCP_INFO size before checking content

Also sync syscall test expectations on Fuchisa.

PiperOrigin-RevId: 355163492
This commit is contained in:
Tamir Duberstein 2021-02-02 07:43:22 -08:00 committed by gVisor bot
parent 5fa683ffdf
commit 00d21b9ae0
1 changed files with 1 additions and 0 deletions

View File

@ -88,6 +88,7 @@ TEST_P(TCPSocketPairTest, CheckTcpInfoFields) {
socklen_t optLen = sizeof(opt);
ASSERT_THAT(getsockopt(sockets->first_fd(), SOL_TCP, TCP_INFO, &opt, &optLen),
SyscallSucceeds());
ASSERT_EQ(optLen, sizeof(opt));
// Validates the received tcp_info fields.
EXPECT_EQ(opt.tcpi_ca_state, TCP_CA_OPEN);