mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Compute size of struct tcp_info instead of hardcoding it.
PiperOrigin-RevId: 263040624
This commit is contained in:
committed by
gVisor bot
parent
eac690e358
commit
691c2f8173
@@ -366,7 +366,7 @@ type TCPInfo struct {
|
||||
}
|
||||
|
||||
// SizeOfTCPInfo is the binary size of a TCPInfo struct.
|
||||
const SizeOfTCPInfo = 104
|
||||
var SizeOfTCPInfo = int(binary.Size(TCPInfo{}))
|
||||
|
||||
// Control message types, from linux/socket.h.
|
||||
const (
|
||||
|
||||
@@ -187,9 +187,9 @@ TEST(ProcNetTCP, EntryUID) {
|
||||
std::vector<TCPEntry> entries =
|
||||
ASSERT_NO_ERRNO_AND_VALUE(ProcNetTCPEntries());
|
||||
TCPEntry e;
|
||||
EXPECT_TRUE(FindByLocalAddr(entries, &e, sockets->first_addr()));
|
||||
ASSERT_TRUE(FindByLocalAddr(entries, &e, sockets->first_addr()));
|
||||
EXPECT_EQ(e.uid, geteuid());
|
||||
EXPECT_TRUE(FindByRemoteAddr(entries, &e, sockets->first_addr()));
|
||||
ASSERT_TRUE(FindByRemoteAddr(entries, &e, sockets->first_addr()));
|
||||
EXPECT_EQ(e.uid, geteuid());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user