mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Set optlen correctly when calling getsockopt.
PiperOrigin-RevId: 253096085
This commit is contained in:
committed by
Shentubot
parent
94ab253d7e
commit
9f77b36fa1
@@ -679,7 +679,7 @@ TEST_P(TCPSocketPairTest, SetCongestionControlFailsForUnsupported) {
|
||||
|
||||
auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair());
|
||||
char old_cc[kTcpCaNameMax];
|
||||
socklen_t optlen;
|
||||
socklen_t optlen = sizeof(old_cc);
|
||||
ASSERT_THAT(getsockopt(sockets->first_fd(), IPPROTO_TCP, TCP_CONGESTION,
|
||||
&old_cc, &optlen),
|
||||
SyscallSucceedsWithValue(0));
|
||||
@@ -690,6 +690,7 @@ TEST_P(TCPSocketPairTest, SetCongestionControlFailsForUnsupported) {
|
||||
SyscallFailsWithErrno(ENOENT));
|
||||
|
||||
char got_cc[kTcpCaNameMax];
|
||||
optlen = sizeof(got_cc);
|
||||
ASSERT_THAT(getsockopt(sockets->first_fd(), IPPROTO_TCP, TCP_CONGESTION,
|
||||
&got_cc, &optlen),
|
||||
SyscallSucceedsWithValue(0));
|
||||
|
||||
Reference in New Issue
Block a user