Skip to content

Commit

Permalink
Initialize optval, update comment
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Duke <[email protected]>
  • Loading branch information
martinduke committed Jul 29, 2024
1 parent 096ea88 commit cb0485e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/common/quic/active_quic_listener_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ TEST_P(ActiveQuicListenerTest, EcnReportingIsEnabled) {
Network::Socket& socket = ActiveQuicListenerPeer::socket(*quic_listener_);
absl::optional<Network::Address::IpVersion> version = socket.ipVersion();
EXPECT_TRUE(version.has_value());
int optval;
int optval = 0;
socklen_t optlen = sizeof(optval);
Api::SysCallIntResult rv;
if (*version == Network::Address::IpVersion::v6) {
Expand All @@ -616,7 +616,9 @@ TEST_P(ActiveQuicListenerTest, EcnReportingIsEnabled) {
return;
}
}
// Check the IPv4 version of the sockopt if it's v4 or dual-stack.
// Check the IPv4 version of the sockopt if the socket is v4 or dual-stack.
// Platform/ APIs for ECN reporting are poorly documented, but this test
// should uncover any issues.
rv = socket.getSocketOption(IPPROTO_IP, IP_RECVTOS, &optval, &optlen);
EXPECT_EQ(rv.return_value_, 0);
EXPECT_EQ(optval, 1);
Expand Down

0 comments on commit cb0485e

Please sign in to comment.