mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Require CAP_NET_RAW to call setsockopt(SO_BINDTODEVICE) in
This causes socket_inet_loopback_isolated_test to fail with hostnet on buildkite (but curiously only on oldkernel). PiperOrigin-RevId: 523528229
This commit is contained in:
committed by
gVisor bot
parent
ba73f3cbf1
commit
5c792e384d
@@ -3319,6 +3319,7 @@ cc_binary(
|
||||
":socket_netlink_util",
|
||||
"//test/util:socket_util",
|
||||
gtest,
|
||||
"//test/util:capability_util",
|
||||
"//test/util:test_main",
|
||||
"//test/util:test_util",
|
||||
"@com_google_absl//absl/time",
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "absl/time/clock.h"
|
||||
#include "absl/time/time.h"
|
||||
#include "test/syscalls/linux/socket_inet_loopback_test_params.h"
|
||||
#include "test/util/capability_util.h"
|
||||
#include "test/util/socket_util.h"
|
||||
#include "test/util/test_util.h"
|
||||
|
||||
@@ -298,6 +299,9 @@ using SocketMultiProtocolInetLoopbackIsolatedTest =
|
||||
::testing::TestWithParam<ProtocolTestParam>;
|
||||
|
||||
TEST_P(SocketMultiProtocolInetLoopbackIsolatedTest, BindToDeviceReusePort) {
|
||||
// setsockopt(SO_BINDTODEVICE) requires CAP_NET_RAW.
|
||||
SKIP_IF(!ASSERT_NO_ERRNO_AND_VALUE(HaveRawIPSocketCapability()));
|
||||
|
||||
ProtocolTestParam const& param = GetParam();
|
||||
TestAddress const& test_addr = V4Loopback();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user