From 948d0bfdf67075e52c4363154596d89a014a637f Mon Sep 17 00:00:00 2001 From: Kaido Kert Date: Tue, 17 Sep 2024 09:01:52 -0700 Subject: [PATCH] Remove SB_HAS_IPV6 config (#4109) Last platform that didn't support it has been removed. SbSocketIsIpv6Supported should be deprecated as follow-up. b/366061817 --- cobalt/csp/source_list_test.cc | 12 ----------- cobalt/network/local_network_test.cc | 4 ---- .../starboard/configuration-public.md | 8 -------- net/socket/tcp_socket_unittest.cc | 2 -- .../android/shared/configuration_public.h | 5 ----- .../arm/hardfp/configuration_public.h | 5 ----- .../arm/softfp/configuration_public.h | 5 ----- .../evergreen/arm64/configuration_public.h | 5 ----- .../evergreen/x64/configuration_public.h | 5 ----- starboard/linux/shared/configuration_public.h | 5 ----- .../posix_socket_accept_test.cc | 14 ------------- .../posix_socket_bind_test.cc | 20 ------------------- .../posix_socket_errno_test.cc | 5 ----- .../posix_compliance/posix_socket_helpers.cc | 9 --------- .../posix_compliance/posix_socket_helpers.h | 2 -- .../posix_socket_listen_test.cc | 7 ------- .../posix_socket_set_options_test.cc | 6 ------ starboard/nplb/socket_accept_test.cc | 7 ------- starboard/nplb/socket_bind_test.cc | 13 ------------ starboard/nplb/socket_connect_test.cc | 7 ------- starboard/nplb/socket_create_test.cc | 9 --------- .../nplb/socket_get_interface_address_test.cc | 7 ------- .../nplb/socket_get_local_address_test.cc | 13 ------------ .../nplb/socket_is_connected_and_idle_test.cc | 13 ------------ starboard/nplb/socket_is_connected_test.cc | 13 ------------ starboard/nplb/socket_listen_test.cc | 7 ------- starboard/nplb/socket_receive_from_test.cc | 9 --------- starboard/nplb/socket_resolve_test.cc | 9 --------- starboard/nplb/socket_send_to_test.cc | 9 --------- starboard/nplb/socket_set_options_test.cc | 7 ------- starboard/nplb/socket_waiter_add_test.cc | 7 ------- starboard/nplb/socket_waiter_remove_test.cc | 7 ------- starboard/nplb/socket_waiter_wait_test.cc | 13 ------------ .../nplb/socket_waiter_wait_timed_test.cc | 13 ------------ starboard/nplb/socket_wrapper_test.cc | 9 --------- starboard/raspi/shared/configuration_public.h | 5 ----- .../linux/socket_get_interface_address.cc | 12 ----------- starboard/shared/posix/socket_bind.cc | 2 -- starboard/shared/posix/socket_internal.cc | 14 +------------ .../shared/posix/socket_is_ipv6_supported.cc | 2 +- starboard/stub/configuration_public.h | 5 ----- 41 files changed, 2 insertions(+), 329 deletions(-) diff --git a/cobalt/csp/source_list_test.cc b/cobalt/csp/source_list_test.cc index 0b5309ae0525..8208850dc47e 100644 --- a/cobalt/csp/source_list_test.cc +++ b/cobalt/csp/source_list_test.cc @@ -224,7 +224,6 @@ TEST_F(SourceListTest, TestInsecureLocalhostDefaultInsecureV4) { EXPECT_FALSE(source_list.Matches(GURL("https://example.locaLHost./"))); } -#if SB_HAS(IPV6) TEST_F(SourceListTest, TestInsecureLocalhostDefaultInsecureV6) { SourceList source_list(&checker_, csp_.get(), "connect-src"); @@ -259,7 +258,6 @@ TEST_F(SourceListTest, TestInsecureLocalhostDefaultInsecureV6) { EXPECT_FALSE(source_list.Matches( GURL("https://[0000:0000:0000:0000:0000:0000:0000:0001]:80/"))); } -#endif TEST_F(SourceListTest, TestInsecureLocalhostInsecureV4) { SourceList source_list(&checker_, csp_.get(), "connect-src"); @@ -279,7 +277,6 @@ TEST_F(SourceListTest, TestInsecureLocalhostInsecureV4) { EXPECT_TRUE(source_list.Matches(GURL("http://127.255.0.0/"))); } -#if SB_HAS(IPV6) TEST_F(SourceListTest, TestInsecureLocalhostInsecureV6) { SourceList source_list(&checker_, csp_.get(), "connect-src"); std::string sources = "'cobalt-insecure-localhost'"; @@ -295,7 +292,6 @@ TEST_F(SourceListTest, TestInsecureLocalhostInsecureV6) { EXPECT_TRUE(source_list.Matches( GURL("http://[0000:0000:0000:0000:0000:0000:0000:0001]:80/"))); } -#endif TEST_F(SourceListTest, TestInsecureLocalhostSecureV4) { SourceList source_list(&checker_, csp_.get(), "connect-src"); @@ -327,7 +323,6 @@ TEST_F(SourceListTest, TestInsecureLocalhostSecureV4) { EXPECT_FALSE(source_list.Matches(GURL("https://example.locaLHost./"))); } -#if SB_HAS(IPV6) TEST_F(SourceListTest, TestInsecureLocalhostSecureV6) { SourceList source_list(&checker_, csp_.get(), "connect-src"); std::string sources = "'cobalt-insecure-localhost'"; @@ -349,7 +344,6 @@ TEST_F(SourceListTest, TestInsecureLocalhostSecureV6) { EXPECT_FALSE(source_list.Matches( GURL("https://[0000:0000:0000:0000:0000:0000:0000:0001]:80/"))); } -#endif TEST_F(SourceListTest, TestInsecurePrivateRangeDefaultV4) { SourceList source_list(&checker_, csp_.get(), "connect-src"); @@ -367,7 +361,6 @@ TEST_F(SourceListTest, TestInsecurePrivateRangeDefaultV4) { EXPECT_FALSE(source_list.Matches(GURL("https://255.255.255.255/"))); } -#if SB_HAS(IPV6) TEST_F(SourceListTest, TestInsecurePrivateRangeDefaultV6) { SourceList source_list(&checker_, csp_.get(), "connect-src"); @@ -382,7 +375,6 @@ TEST_F(SourceListTest, TestInsecurePrivateRangeDefaultV6) { EXPECT_FALSE(source_list.Matches(GURL("http://[FE80::]/"))); EXPECT_FALSE(source_list.Matches(GURL("https://[FE80::]/"))); } -#endif TEST_F(SourceListTest, TestInsecurePrivateRangeV4Private) { std::string sources = "'cobalt-insecure-private-range'"; @@ -416,7 +408,6 @@ TEST_F(SourceListTest, TestInsecurePrivateRangeV4Secure) { EXPECT_FALSE(source_list.Matches(GURL("https://0.0.0.0/"))); } -#if SB_HAS(IPV6) TEST_F(SourceListTest, TestInsecurePrivateRangeV6ULA) { std::string sources = "'cobalt-insecure-private-range'"; // These are insecure calls. @@ -446,7 +437,6 @@ TEST_F(SourceListTest, TestInsecurePrivateRangeV6Secure) { GURL("https://[2606:2800:220:1:248:1893:25c8:1946]/"))); EXPECT_FALSE(source_list.Matches(GURL("https://[FE80::]/"))); } -#endif TEST_F(SourceListTest, TestInsecureLocalNetworkDefaultV4Local) { std::string sources = "'cobalt-insecure-local-network'"; @@ -481,7 +471,6 @@ TEST_F(SourceListTest, TestInsecureLocalNetworkDefaultV4Secure) { EXPECT_FALSE(source_list.Matches(GURL("https://143.195.170.1/"))); } -#if SB_HAS(IPV6) TEST_F(SourceListTest, TestInsecureLocalNetworkDefaultV6Local) { std::string sources = "'cobalt-insecure-local-network'"; SourceList source_list(&checker_, csp_.get(), "connect-src"); @@ -520,7 +509,6 @@ TEST_F(SourceListTest, TestInsecureLocalNetworkDefaultV6Secure) { EXPECT_FALSE(source_list.Matches( GURL("https://[2606:2800:220:1:248:1893:25c8:1946]/"))); } -#endif TEST_F(SourceListTest, TestInvalidHash) { std::string sources = "'sha256-c3uoUQo23pT8hqB5MoAZnI9LiPUc+lWgGBKHfV07iAM='"; diff --git a/cobalt/network/local_network_test.cc b/cobalt/network/local_network_test.cc index e0f604a008ed..88d475b7c4b4 100644 --- a/cobalt/network/local_network_test.cc +++ b/cobalt/network/local_network_test.cc @@ -43,8 +43,6 @@ TEST(IsPrivateRange, v4) { EXPECT_FALSE(IsIPInPrivateRange(ParseSocketAddress("239.255.255.255"))); } -#if SB_HAS(IPV6) - TEST(IsPrivateRange, v6) { EXPECT_TRUE(IsIPInPrivateRange(ParseSocketAddress("[fd00::]"))); EXPECT_TRUE(IsIPInPrivateRange(ParseSocketAddress("[fd00:1:2:3:4:5::]"))); @@ -53,7 +51,5 @@ TEST(IsPrivateRange, v6) { ParseSocketAddress("[2606:2800:220:1:248:1893:25c8:1946]"))); } -#endif // SB_HAS(IPV6) - } // namespace network } // namespace cobalt diff --git a/cobalt/site/docs/reference/starboard/configuration-public.md b/cobalt/site/docs/reference/starboard/configuration-public.md index b1dd06ceb1d8..91dfb95c01c4 100644 --- a/cobalt/site/docs/reference/starboard/configuration-public.md +++ b/cobalt/site/docs/reference/starboard/configuration-public.md @@ -9,14 +9,6 @@ Book: /youtube/cobalt/_book.yaml | :--- | | **`SB_HAS_QUIRK_SUPPORT_INT16_AUDIO_SAMPLES`**

The implementation is allowed to support kSbMediaAudioSampleTypeInt16 only when this macro is defined.

By default, this property is undefined. | - -## Network Configuration - -| Properties | -| :--- | -| **`SB_HAS_IPV6`**

Specifies whether this platform supports IPV6.

The default value in the Stub implementation is `1` | - - ## System Header Configuration Any system headers listed here that are not provided by the platform will be emulated in starboard/types.h. diff --git a/net/socket/tcp_socket_unittest.cc b/net/socket/tcp_socket_unittest.cc index 89251dd9b160..a5384392a9d6 100644 --- a/net/socket/tcp_socket_unittest.cc +++ b/net/socket/tcp_socket_unittest.cc @@ -371,7 +371,6 @@ TEST_F(TCPSocketTest, Accept2Connections) { EXPECT_EQ(accepted_address2.address(), local_address_.address()); } -#if !defined(STARBOARD) || SB_HAS(IPV6) // Test listening and accepting with a socket bound to an IPv6 address. TEST_F(TCPSocketTest, AcceptIPv6) { bool initialized = false; @@ -398,7 +397,6 @@ TEST_F(TCPSocketTest, AcceptIPv6) { EXPECT_THAT(connect_callback.GetResult(connect_result), IsOk()); } -#endif TEST_F(TCPSocketTest, ReadWrite) { ASSERT_NO_FATAL_FAILURE(SetUpListenIPv4()); diff --git a/starboard/android/shared/configuration_public.h b/starboard/android/shared/configuration_public.h index ac3e0e187fea..f13aeec2d0c5 100644 --- a/starboard/android/shared/configuration_public.h +++ b/starboard/android/shared/configuration_public.h @@ -49,9 +49,4 @@ #define SB_IS_WCHAR_T_UNSIGNED 1 #endif -// --- Network Configuration ------------------------------------------------- - -// Specifies whether this platform supports IPV6. -#define SB_HAS_IPV6 1 - #endif // STARBOARD_ANDROID_SHARED_CONFIGURATION_PUBLIC_H_ diff --git a/starboard/evergreen/arm/hardfp/configuration_public.h b/starboard/evergreen/arm/hardfp/configuration_public.h index a30aafb14d7b..5627adcc7b98 100644 --- a/starboard/evergreen/arm/hardfp/configuration_public.h +++ b/starboard/evergreen/arm/hardfp/configuration_public.h @@ -47,9 +47,4 @@ #define SB_IS_WCHAR_T_UNSIGNED 1 #endif -// --- Network Configuration ------------------------------------------------- - -// Specifies whether this platform supports IPV6. -#define SB_HAS_IPV6 1 - #endif // STARBOARD_EVERGREEN_ARM_HARDFP_CONFIGURATION_PUBLIC_H_ diff --git a/starboard/evergreen/arm/softfp/configuration_public.h b/starboard/evergreen/arm/softfp/configuration_public.h index 97e37ed7a253..0c4cce010c0b 100644 --- a/starboard/evergreen/arm/softfp/configuration_public.h +++ b/starboard/evergreen/arm/softfp/configuration_public.h @@ -47,9 +47,4 @@ #define SB_IS_WCHAR_T_UNSIGNED 1 #endif -// --- Network Configuration ------------------------------------------------- - -// Specifies whether this platform supports IPV6. -#define SB_HAS_IPV6 1 - #endif // STARBOARD_EVERGREEN_ARM_SOFTFP_CONFIGURATION_PUBLIC_H_ diff --git a/starboard/evergreen/arm64/configuration_public.h b/starboard/evergreen/arm64/configuration_public.h index 5e3c77ed4485..6fe706326603 100644 --- a/starboard/evergreen/arm64/configuration_public.h +++ b/starboard/evergreen/arm64/configuration_public.h @@ -47,9 +47,4 @@ #define SB_IS_WCHAR_T_UNSIGNED 1 #endif -// --- Network Configuration ------------------------------------------------- - -// Specifies whether this platform supports IPV6. -#define SB_HAS_IPV6 1 - #endif // STARBOARD_EVERGREEN_ARM64_CONFIGURATION_PUBLIC_H_ diff --git a/starboard/evergreen/x64/configuration_public.h b/starboard/evergreen/x64/configuration_public.h index 22b10cc6b9bd..6d788e8215a4 100644 --- a/starboard/evergreen/x64/configuration_public.h +++ b/starboard/evergreen/x64/configuration_public.h @@ -47,9 +47,4 @@ #define SB_IS_WCHAR_T_UNSIGNED 1 #endif -// --- Network Configuration ------------------------------------------------- - -// Specifies whether this platform supports IPV6. -#define SB_HAS_IPV6 1 - #endif // STARBOARD_EVERGREEN_X64_CONFIGURATION_PUBLIC_H_ diff --git a/starboard/linux/shared/configuration_public.h b/starboard/linux/shared/configuration_public.h index 0bbee54bd39b..eb5eb5634b77 100644 --- a/starboard/linux/shared/configuration_public.h +++ b/starboard/linux/shared/configuration_public.h @@ -49,11 +49,6 @@ #define SB_IS_WCHAR_T_UNSIGNED 1 #endif -// --- Network Configuration ------------------------------------------------- - -// Specifies whether this platform supports IPV6. -#define SB_HAS_IPV6 1 - // --- Media Configuration --------------------------------------------------- // The path of video_dmp_writer.h. Defined here to avoid errors building on diff --git a/starboard/nplb/posix_compliance/posix_socket_accept_test.cc b/starboard/nplb/posix_compliance/posix_socket_accept_test.cc index 248f1761c381..fe8c986407f7 100644 --- a/starboard/nplb/posix_compliance/posix_socket_accept_test.cc +++ b/starboard/nplb/posix_compliance/posix_socket_accept_test.cc @@ -51,18 +51,11 @@ TEST(PosixSocketAcceptTest, RainyDayNoConnection) { } // bind socket with local address -#if SB_HAS(IPV6) sockaddr_in6 address = {}; EXPECT_TRUE( PosixGetLocalAddressIPv4(reinterpret_cast(&address)) == 0 || PosixGetLocalAddressIPv6(reinterpret_cast(&address)) == 0); address.sin6_port = htons(GetPortNumberForTests()); -#else - sockaddr address = {0}; - EXPECT_TRUE(PosixGetLocalAddressIPv4(&address) == 0); - sockaddr_in* address_ptr = reinterpret_cast(&address); - address_ptr->sin_port = htons(GetPortNumberForTests()); -#endif result = bind(socket_listen_fd, reinterpret_cast(&address), sizeof(sockaddr)); @@ -135,18 +128,11 @@ TEST(PosixSocketAcceptTest, RainyDayNotListening) { } // bind socket with local address -#if SB_HAS(IPV6) sockaddr_in6 address = {}; EXPECT_TRUE( PosixGetLocalAddressIPv4(reinterpret_cast(&address)) == 0 || PosixGetLocalAddressIPv6(reinterpret_cast(&address)) == 0); address.sin6_port = htons(GetPortNumberForTests()); -#else - sockaddr address = {0}; - EXPECT_TRUE(PosixGetLocalAddressIPv4(&address) == 0); - sockaddr_in* address_ptr = reinterpret_cast(&address); - address_ptr->sin_port = htons(GetPortNumberForTests()); -#endif EXPECT_TRUE(result == 0); if (result != 0) { close(socket_fd); diff --git a/starboard/nplb/posix_compliance/posix_socket_bind_test.cc b/starboard/nplb/posix_compliance/posix_socket_bind_test.cc index a5e7a1225eba..04eb28449ca0 100644 --- a/starboard/nplb/posix_compliance/posix_socket_bind_test.cc +++ b/starboard/nplb/posix_compliance/posix_socket_bind_test.cc @@ -44,7 +44,6 @@ TEST(PosixSocketBindTest, RainyDayNullNull) { EXPECT_FALSE(bind(invalid_socket_fd, NULL, 0) == 0); } -#if SB_HAS(IPV6) TEST(PosixSocketBindTest, RainyDayWrongAddressType) { int socket_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); ASSERT_TRUE(socket_fd > 0); @@ -65,7 +64,6 @@ TEST(PosixSocketBindTest, RainyDayWrongAddressType) { sizeof(sockaddr_in)) == 0); EXPECT_TRUE(close(socket_fd) == 0); } -#endif TEST(PosixSocketBindTest, RainyDayBadInterface) { int socket_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); @@ -82,18 +80,11 @@ TEST(PosixSocketBindTest, RainyDayBadInterface) { } TEST(PosixSocketBindTest, SunnyDayLocalInterface) { -#if SB_HAS(IPV6) sockaddr_in6 address = {}; EXPECT_TRUE( PosixGetLocalAddressIPv4(reinterpret_cast(&address)) == 0 || PosixGetLocalAddressIPv6(reinterpret_cast(&address)) == 0); address.sin6_port = htons(GetPortNumberForTests()); -#else - sockaddr address = {0}; - EXPECT_TRUE(PosixGetLocalAddressIPv4(&address) == 0); - sockaddr_in* address_ptr = reinterpret_cast(&address); - address_ptr->sin_port = htons(GetPortNumberForTests()); -#endif int socket_domain = AF_INET; int socket_type = SOCK_STREAM; @@ -138,14 +129,12 @@ class PosixSocketBindPairFilterTest int GetFilterType() { return GetParam().second; } }; -#if SB_HAS(IPV6) class PosixSocketBindPairCSTest : public ::testing::TestWithParam> { public: int GetServerAddressType() { return GetParam().first; } int GetClientAddressType() { return GetParam().second; } }; -#endif TEST_P(PosixSocketBindPairFilterTest, RainyDayNullSocketPair) { sockaddr_in address = {}; @@ -225,7 +214,6 @@ TEST_P(PosixSocketBindPairFilterTest, RainyDayBadInterfacePair) { EXPECT_TRUE(close(socket_fd) == 0); } -#if SB_HAS(IPV6) TEST_P(PosixSocketBindPairCSTest, RainyDayWrongAddressTypePair) { return; int socket_fd = socket(GetServerAddressType(), SOCK_STREAM, IPPROTO_TCP); @@ -247,9 +235,7 @@ TEST_P(PosixSocketBindPairCSTest, RainyDayWrongAddressTypePair) { sizeof(sockaddr_in)) == 0); EXPECT_TRUE(close(socket_fd) == 0); } -#endif -#if SB_HAS(IPV6) INSTANTIATE_TEST_SUITE_P(PosixSocketBindTest, PosixSocketBindPairFilterTest, ::testing::Values(std::make_pair(AF_INET, AF_INET), @@ -260,12 +246,6 @@ INSTANTIATE_TEST_SUITE_P(PosixSocketBindTest, ::testing::Values(std::make_pair(AF_INET, AF_INET6), std::make_pair(AF_INET6, AF_INET)), GetPosixSocketAddressTypeFilterPairName); -#else -INSTANTIATE_TEST_SUITE_P(PosixSocketBindTest, - PosixSocketBindPairFilterTest, - ::testing::Values(std::make_pair(AF_INET, AF_INET)), - GetPosixSocketAddressTypeFilterPairName); -#endif } // namespace } // namespace nplb diff --git a/starboard/nplb/posix_compliance/posix_socket_errno_test.cc b/starboard/nplb/posix_compliance/posix_socket_errno_test.cc index a9cba3491e41..582693ba895a 100644 --- a/starboard/nplb/posix_compliance/posix_socket_errno_test.cc +++ b/starboard/nplb/posix_compliance/posix_socket_errno_test.cc @@ -45,14 +45,9 @@ TEST(PosixErrnoTest, ConnectUnavailableAddress) { ASSERT_TRUE(socket_fd > 0); sockaddr_in6 address = {}; -#if SB_HAS(IPV6) EXPECT_TRUE( PosixGetLocalAddressIPv4(reinterpret_cast(&address)) == 0 || PosixGetLocalAddressIPv6(reinterpret_cast(&address)) == 0); -#else - EXPECT_TRUE(PosixGetLocalAddressIPv4(reinterpret_cast(&address)) == - 0); -#endif // Attempt to connect to an address where we expect connection to be refused connect(socket_fd, (struct sockaddr*)&address, sizeof(address)); diff --git a/starboard/nplb/posix_compliance/posix_socket_helpers.cc b/starboard/nplb/posix_compliance/posix_socket_helpers.cc index 15770f5d61aa..c434d3480bf5 100644 --- a/starboard/nplb/posix_compliance/posix_socket_helpers.cc +++ b/starboard/nplb/posix_compliance/posix_socket_helpers.cc @@ -45,18 +45,11 @@ int PosixSocketCreateAndConnect(int server_domain, return -1; } // bind socket with local address -#if SB_HAS(IPV6) sockaddr_in6 address = {}; EXPECT_TRUE( PosixGetLocalAddressIPv4(reinterpret_cast(&address)) == 0 || PosixGetLocalAddressIPv6(reinterpret_cast(&address)) == 0); address.sin6_port = htons(GetPortNumberForTests()); -#else - sockaddr address = {0}; - EXPECT_TRUE(PosixGetLocalAddressIPv4(&address) == 0); - sockaddr_in* address_ptr = reinterpret_cast(&address); - address_ptr->sin_port = htons(GetPortNumberForTests()); -#endif result = bind(*listen_socket_fd, reinterpret_cast(&address), sizeof(struct sockaddr_in)); @@ -164,7 +157,6 @@ int PosixGetLocalAddressIPv4(sockaddr* address_ptr) { return result; } -#if SB_HAS(IPV6) int PosixGetLocalAddressIPv6(sockaddr* address_ptr) { int result = -1; struct ifaddrs* ifaddr; @@ -189,7 +181,6 @@ int PosixGetLocalAddressIPv6(sockaddr* address_ptr) { freeifaddrs(ifaddr); return result; } -#endif bool PosixWriteBySpinning(int socket, const char* data, diff --git a/starboard/nplb/posix_compliance/posix_socket_helpers.h b/starboard/nplb/posix_compliance/posix_socket_helpers.h index eb2d39097a0a..45fe99c08558 100644 --- a/starboard/nplb/posix_compliance/posix_socket_helpers.h +++ b/starboard/nplb/posix_compliance/posix_socket_helpers.h @@ -50,9 +50,7 @@ int PosixSocketCreateAndConnect(int server_domain, int* server_socket_fd, int* client_socket_fd); int PosixGetLocalAddressIPv4(sockaddr* address_ptr); -#if SB_HAS(IPV6) int PosixGetLocalAddressIPv6(sockaddr* address_ptr); -#endif // SB_HAS(IPV6) int PosixSocketSetReceiveBufferSize(int socket_fd, int32_t size); int PosixSocketSetSendBufferSize(int socket_fd, int32_t size); diff --git a/starboard/nplb/posix_compliance/posix_socket_listen_test.cc b/starboard/nplb/posix_compliance/posix_socket_listen_test.cc index 68b7c01b7755..3383632238d1 100644 --- a/starboard/nplb/posix_compliance/posix_socket_listen_test.cc +++ b/starboard/nplb/posix_compliance/posix_socket_listen_test.cc @@ -42,18 +42,11 @@ TEST(PosixSocketListenTest, SunnyDayUnbound) { } // bind socket with local address -#if SB_HAS(IPV6) sockaddr_in6 address = {}; EXPECT_TRUE( PosixGetLocalAddressIPv4(reinterpret_cast(&address)) == 0 || PosixGetLocalAddressIPv6(reinterpret_cast(&address)) == 0); address.sin6_port = htons(GetPortNumberForTests()); -#else - sockaddr address = {0}; - EXPECT_TRUE(PosixGetLocalAddressIPv4(&address) == 0); - sockaddr_in* address_ptr = reinterpret_cast(&address); - address_ptr->sin_port = htons(GetPortNumberForTests()); -#endif result = bind(socket_fd, reinterpret_cast(&address), sizeof(sockaddr)); diff --git a/starboard/nplb/posix_compliance/posix_socket_set_options_test.cc b/starboard/nplb/posix_compliance/posix_socket_set_options_test.cc index 2eeb5af33724..d113c3cd6fc7 100644 --- a/starboard/nplb/posix_compliance/posix_socket_set_options_test.cc +++ b/starboard/nplb/posix_compliance/posix_socket_set_options_test.cc @@ -108,15 +108,9 @@ TEST_P(PosixSocketSetOptionsTest, RainyDayInvalidSocket) { -1); } -#if SB_HAS(IPV6) INSTANTIATE_TEST_SUITE_P(PosixSocketAddressTypes, PosixSocketSetOptionsTest, ::testing::Values(AF_INET, AF_INET6)); -#else -INSTANTIATE_TEST_SUITE_P(PosixSocketAddressTypes, - PosixSocketSetOptionsTest, - ::testing::Values(AF_INET)); -#endif } // namespace } // namespace nplb diff --git a/starboard/nplb/socket_accept_test.cc b/starboard/nplb/socket_accept_test.cc index fcb34dee9387..477ccf300cb4 100644 --- a/starboard/nplb/socket_accept_test.cc +++ b/starboard/nplb/socket_accept_test.cc @@ -75,18 +75,11 @@ TEST_P(SbSocketAcceptTest, RainyDayInvalidSocket) { EXPECT_EQ(kSbSocketInvalid, SbSocketAccept(kSbSocketInvalid)); } -#if SB_HAS(IPV6) INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, SbSocketAcceptTest, ::testing::Values(kSbSocketAddressTypeIpv4, kSbSocketAddressTypeIpv6), GetSbSocketAddressTypeName); -#else -INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, - SbSocketAcceptTest, - ::testing::Values(kSbSocketAddressTypeIpv4), - GetSbSocketAddressTypeName); -#endif } // namespace } // namespace nplb diff --git a/starboard/nplb/socket_bind_test.cc b/starboard/nplb/socket_bind_test.cc index f5b3a1a63aac..6da9caa7bcdc 100644 --- a/starboard/nplb/socket_bind_test.cc +++ b/starboard/nplb/socket_bind_test.cc @@ -33,7 +33,6 @@ class SbSocketBindTest SbSocketResolveFilter GetFilterType() { return GetParam().second; } }; -#if SB_HAS(IPV6) class PairSbSocketBindTest : public ::testing::TestWithParam< std::pair > { @@ -41,7 +40,6 @@ class PairSbSocketBindTest SbSocketAddressType GetServerAddressType() { return GetParam().first; } SbSocketAddressType GetClientAddressType() { return GetParam().second; } }; -#endif // This is to use NULL in asserts, which otherwise complain about long // vs. pointer type. @@ -73,7 +71,6 @@ TEST_F(SbSocketBindTest, RainyDayNullNull) { EXPECT_SB_SOCKET_ERROR_IS_ERROR(SbSocketBind(kSbSocketInvalid, NULL)); } -#if SB_HAS(IPV6) TEST_P(PairSbSocketBindTest, RainyDayWrongAddressType) { SbSocket server_socket = CreateServerTcpSocket(GetServerAddressType()); ASSERT_TRUE(SbSocketIsValid(server_socket)); @@ -91,7 +88,6 @@ TEST_P(PairSbSocketBindTest, RainyDayWrongAddressType) { EXPECT_TRUE(SbSocketDestroy(server_socket)); } -#endif TEST_P(SbSocketBindTest, RainyDayBadInterface) { SbSocket server_socket = CreateServerTcpSocket(GetAddressType()); @@ -123,7 +119,6 @@ TEST_F(SbSocketBindTest, SunnyDayLocalInterface) { EXPECT_TRUE(SbSocketDestroy(server_socket)); } -#if SB_HAS(IPV6) INSTANTIATE_TEST_CASE_P( SbSocketAddressTypes, SbSocketBindTest, @@ -138,14 +133,6 @@ INSTANTIATE_TEST_CASE_P( std::make_pair(kSbSocketAddressTypeIpv4, kSbSocketAddressTypeIpv6), std::make_pair(kSbSocketAddressTypeIpv6, kSbSocketAddressTypeIpv4)), GetSbSocketAddressTypePairName); -#else -INSTANTIATE_TEST_CASE_P( - SbSocketAddressTypes, - SbSocketBindTest, - ::testing::Values(std::make_pair(kSbSocketAddressTypeIpv4, - kSbSocketResolveFilterIpv4)), - GetSbSocketAddressTypeFilterPairName); -#endif } // namespace } // namespace nplb diff --git a/starboard/nplb/socket_connect_test.cc b/starboard/nplb/socket_connect_test.cc index 7c545a003959..6dc6adade599 100644 --- a/starboard/nplb/socket_connect_test.cc +++ b/starboard/nplb/socket_connect_test.cc @@ -45,18 +45,11 @@ TEST_F(SbSocketConnectTest, RainyDayNullNull) { EXPECT_SB_SOCKET_ERROR_IS_ERROR(SbSocketConnect(kSbSocketInvalid, NULL)); } -#if SB_HAS(IPV6) INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, SbSocketConnectTest, ::testing::Values(kSbSocketAddressTypeIpv4, kSbSocketAddressTypeIpv6), GetSbSocketAddressTypeName); -#else -INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, - SbSocketConnectTest, - ::testing::Values(kSbSocketAddressTypeIpv4), - GetSbSocketAddressTypeName); -#endif } // namespace } // namespace nplb diff --git a/starboard/nplb/socket_create_test.cc b/starboard/nplb/socket_create_test.cc index 301b12eb75c7..1a12b82563e2 100644 --- a/starboard/nplb/socket_create_test.cc +++ b/starboard/nplb/socket_create_test.cc @@ -36,7 +36,6 @@ class PairSbSocketCreateTest TEST_P(PairSbSocketCreateTest, Create) { SbSocket socket = SbSocketCreate(GetAddressType(), GetProtocol()); -#if !SB_HAS(IPV6) // It is allowed for a platform not to support IPv6 sockets, but we use this // test to at least exercise the code path. if (kSbSocketAddressTypeIpv6 == GetAddressType()) { @@ -45,7 +44,6 @@ TEST_P(PairSbSocketCreateTest, Create) { } return; } -#endif if (kSbSocketProtocolUdp == GetProtocol()) { // It is allowed for a platform not to support UDP sockets, but we use this // test to at least exercise the code path. @@ -80,18 +78,11 @@ TEST_P(SbSocketCreateTest, ManyTcpAtOnce) { } } -#if SB_HAS(IPV6) INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, SbSocketCreateTest, ::testing::Values(kSbSocketAddressTypeIpv4, kSbSocketAddressTypeIpv6), GetSbSocketAddressTypeName); -#else -INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, - SbSocketCreateTest, - ::testing::Values(kSbSocketAddressTypeIpv4), - GetSbSocketAddressTypeName); -#endif INSTANTIATE_TEST_CASE_P( SbSocketTypes, diff --git a/starboard/nplb/socket_get_interface_address_test.cc b/starboard/nplb/socket_get_interface_address_test.cc index 2bfc328247cd..e793fd883548 100644 --- a/starboard/nplb/socket_get_interface_address_test.cc +++ b/starboard/nplb/socket_get_interface_address_test.cc @@ -173,18 +173,11 @@ TEST_P(SbSocketGetInterfaceAddressTest, SunnyDaySourceNotLoopback) { SB_ARRAY_SIZE(source.address))); } -#if SB_HAS(IPV6) INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, SbSocketGetInterfaceAddressTest, ::testing::Values(kSbSocketAddressTypeIpv4, kSbSocketAddressTypeIpv6), GetSbSocketAddressTypeName); -#else -INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, - SbSocketGetInterfaceAddressTest, - ::testing::Values(kSbSocketAddressTypeIpv4), - GetSbSocketAddressTypeName); -#endif // SB_HAS(IPV6) } // namespace } // namespace nplb diff --git a/starboard/nplb/socket_get_local_address_test.cc b/starboard/nplb/socket_get_local_address_test.cc index 29d9a6ddbf45..1ab95db1f325 100644 --- a/starboard/nplb/socket_get_local_address_test.cc +++ b/starboard/nplb/socket_get_local_address_test.cc @@ -121,7 +121,6 @@ TEST_P(PairSbSocketGetLocalAddressTest, SunnyDayConnected) { EXPECT_TRUE(SbSocketDestroy(trio.listen_socket)); } -#if SB_HAS(IPV6) INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, SbSocketGetLocalAddressTest, ::testing::Values(kSbSocketAddressTypeIpv4, @@ -135,18 +134,6 @@ INSTANTIATE_TEST_CASE_P( std::make_pair(kSbSocketAddressTypeIpv6, kSbSocketAddressTypeIpv6), std::make_pair(kSbSocketAddressTypeIpv6, kSbSocketAddressTypeIpv4)), GetSbSocketAddressTypePairName); -#else -INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, - SbSocketGetLocalAddressTest, - ::testing::Values(kSbSocketAddressTypeIpv4), - GetSbSocketAddressTypeName); -INSTANTIATE_TEST_CASE_P( - SbSocketAddressTypes, - PairSbSocketGetLocalAddressTest, - ::testing::Values(std::make_pair(kSbSocketAddressTypeIpv4, - kSbSocketAddressTypeIpv4)), - GetSbSocketAddressTypePairName); -#endif } // namespace } // namespace nplb diff --git a/starboard/nplb/socket_is_connected_and_idle_test.cc b/starboard/nplb/socket_is_connected_and_idle_test.cc index 32c75760569e..a140aa2acd72 100644 --- a/starboard/nplb/socket_is_connected_and_idle_test.cc +++ b/starboard/nplb/socket_is_connected_and_idle_test.cc @@ -94,7 +94,6 @@ TEST_P(SbSocketIsConnectedAndIdleTest, SunnyDayListeningNotConnected) { EXPECT_TRUE(SbSocketDestroy(server_socket)); } -#if SB_HAS(IPV6) INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, SbSocketIsConnectedAndIdleTest, ::testing::Values(kSbSocketAddressTypeIpv4, @@ -108,18 +107,6 @@ INSTANTIATE_TEST_CASE_P( std::make_pair(kSbSocketAddressTypeIpv6, kSbSocketAddressTypeIpv6), std::make_pair(kSbSocketAddressTypeIpv6, kSbSocketAddressTypeIpv4)), GetSbSocketAddressTypePairName); -#else -INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, - SbSocketIsConnectedAndIdleTest, - ::testing::Values(kSbSocketAddressTypeIpv4), - GetSbSocketAddressTypeName); -INSTANTIATE_TEST_CASE_P( - SbSocketAddressTypes, - PairSbSocketIsConnectedAndIdleTest, - ::testing::Values(std::make_pair(kSbSocketAddressTypeIpv4, - kSbSocketAddressTypeIpv4)), - GetSbSocketAddressTypePairName); -#endif } // namespace } // namespace nplb diff --git a/starboard/nplb/socket_is_connected_test.cc b/starboard/nplb/socket_is_connected_test.cc index 3c2bfdd9fe4f..550e3709e656 100644 --- a/starboard/nplb/socket_is_connected_test.cc +++ b/starboard/nplb/socket_is_connected_test.cc @@ -77,7 +77,6 @@ TEST_P(SbSocketIsConnectedTest, SunnyDayListeningNotConnected) { EXPECT_TRUE(SbSocketDestroy(server_socket)); } -#if SB_HAS(IPV6) INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, SbSocketIsConnectedTest, ::testing::Values(kSbSocketAddressTypeIpv4, @@ -91,18 +90,6 @@ INSTANTIATE_TEST_CASE_P( std::make_pair(kSbSocketAddressTypeIpv6, kSbSocketAddressTypeIpv6), std::make_pair(kSbSocketAddressTypeIpv6, kSbSocketAddressTypeIpv4)), GetSbSocketAddressTypePairName); -#else -INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, - SbSocketIsConnectedTest, - ::testing::Values(kSbSocketAddressTypeIpv4), - GetSbSocketAddressTypeName); -INSTANTIATE_TEST_CASE_P( - SbSocketAddressTypes, - PairSbSocketIsConnectedTest, - ::testing::Values(std::make_pair(kSbSocketAddressTypeIpv4, - kSbSocketAddressTypeIpv4)), - GetSbSocketAddressTypePairName); -#endif } // namespace } // namespace nplb diff --git a/starboard/nplb/socket_listen_test.cc b/starboard/nplb/socket_listen_test.cc index 9dff540e5c8f..981d5b51ade9 100644 --- a/starboard/nplb/socket_listen_test.cc +++ b/starboard/nplb/socket_listen_test.cc @@ -50,18 +50,11 @@ TEST_P(SbSocketListenTest, SunnyDayUnbound) { EXPECT_TRUE(SbSocketDestroy(server_socket)); } -#if SB_HAS(IPV6) INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, SbSocketListenTest, ::testing::Values(kSbSocketAddressTypeIpv4, kSbSocketAddressTypeIpv6), GetSbSocketAddressTypeName); -#else -INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, - SbSocketListenTest, - ::testing::Values(kSbSocketAddressTypeIpv4), - GetSbSocketAddressTypeName); -#endif } // namespace } // namespace nplb diff --git a/starboard/nplb/socket_receive_from_test.cc b/starboard/nplb/socket_receive_from_test.cc index 1fc8a54ea7c3..ce4a43d9146a 100644 --- a/starboard/nplb/socket_receive_from_test.cc +++ b/starboard/nplb/socket_receive_from_test.cc @@ -124,7 +124,6 @@ TEST(SbSocketReceiveFromTest, RainyDayInvalidSocket) { EXPECT_EQ(-1, result); } -#if SB_HAS(IPV6) INSTANTIATE_TEST_CASE_P( SbSocketAddressTypes, PairSbSocketReceiveFromTest, @@ -133,14 +132,6 @@ INSTANTIATE_TEST_CASE_P( std::make_pair(kSbSocketAddressTypeIpv6, kSbSocketAddressTypeIpv6), std::make_pair(kSbSocketAddressTypeIpv6, kSbSocketAddressTypeIpv4)), GetSbSocketAddressTypePairName); -#else -INSTANTIATE_TEST_CASE_P( - SbSocketAddressTypes, - PairSbSocketReceiveFromTest, - ::testing::Values(std::make_pair(kSbSocketAddressTypeIpv4, - kSbSocketAddressTypeIpv4)), - GetSbSocketAddressTypePairName); -#endif } // namespace } // namespace nplb diff --git a/starboard/nplb/socket_resolve_test.cc b/starboard/nplb/socket_resolve_test.cc index ad923c00be9f..b07a20a5e5b2 100644 --- a/starboard/nplb/socket_resolve_test.cc +++ b/starboard/nplb/socket_resolve_test.cc @@ -108,7 +108,6 @@ TEST_F(SbSocketResolveTest, RainyDayNullHostname) { ASSERT_EQ(kNull, resolution); } -#if SB_HAS(IPV6) INSTANTIATE_TEST_CASE_P( SbSocketAddressTypes, SbSocketResolveTest, @@ -116,14 +115,6 @@ INSTANTIATE_TEST_CASE_P( std::make_pair(kSbSocketResolveFilterIpv4, kSbSocketAddressTypeIpv4), std::make_pair(kSbSocketResolveFilterIpv6, kSbSocketAddressTypeIpv6)), GetSbSocketFilterAddressTypePairName); -#else -INSTANTIATE_TEST_CASE_P( - SbSocketAddressTypes, - SbSocketResolveTest, - ::testing::Values(std::make_pair(kSbSocketResolveFilterIpv4, - kSbSocketAddressTypeIpv4)), - GetSbSocketFilterAddressTypePairName); -#endif } // namespace } // namespace nplb diff --git a/starboard/nplb/socket_send_to_test.cc b/starboard/nplb/socket_send_to_test.cc index 48f503438c1d..f56a681680c7 100644 --- a/starboard/nplb/socket_send_to_test.cc +++ b/starboard/nplb/socket_send_to_test.cc @@ -191,7 +191,6 @@ TEST_P(PairSbSocketSendToTest, RainyDaySendToSocketConnectionReset) { << " tries."; } -#if SB_HAS(IPV6) INSTANTIATE_TEST_CASE_P( SbSocketAddressTypes, PairSbSocketSendToTest, @@ -200,14 +199,6 @@ INSTANTIATE_TEST_CASE_P( std::make_pair(kSbSocketAddressTypeIpv6, kSbSocketAddressTypeIpv6), std::make_pair(kSbSocketAddressTypeIpv6, kSbSocketAddressTypeIpv4)), GetSbSocketAddressTypePairName); -#else -INSTANTIATE_TEST_CASE_P( - SbSocketAddressTypes, - PairSbSocketSendToTest, - ::testing::Values(std::make_pair(kSbSocketAddressTypeIpv4, - kSbSocketAddressTypeIpv4)), - GetSbSocketAddressTypePairName); -#endif } // namespace } // namespace nplb } // namespace starboard diff --git a/starboard/nplb/socket_set_options_test.cc b/starboard/nplb/socket_set_options_test.cc index 603be92c5983..303a1bbf93ec 100644 --- a/starboard/nplb/socket_set_options_test.cc +++ b/starboard/nplb/socket_set_options_test.cc @@ -64,18 +64,11 @@ TEST_P(SbSocketSetOptionsTest, RainyDayInvalidSocket) { // TODO: Come up with some way to test the effects of these options. -#if SB_HAS(IPV6) INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, SbSocketSetOptionsTest, ::testing::Values(kSbSocketAddressTypeIpv4, kSbSocketAddressTypeIpv6), GetSbSocketAddressTypeName); -#else -INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, - SbSocketSetOptionsTest, - ::testing::Values(kSbSocketAddressTypeIpv4), - GetSbSocketAddressTypeName); -#endif } // namespace } // namespace nplb diff --git a/starboard/nplb/socket_waiter_add_test.cc b/starboard/nplb/socket_waiter_add_test.cc index f1d60cc85436..15e5c2da9136 100644 --- a/starboard/nplb/socket_waiter_add_test.cc +++ b/starboard/nplb/socket_waiter_add_test.cc @@ -206,18 +206,11 @@ TEST_P(SbSocketWaiterAddTest, RainyDayNoInterest) { EXPECT_TRUE(SbSocketWaiterDestroy(waiter)); } -#if SB_HAS(IPV6) INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, SbSocketWaiterAddTest, ::testing::Values(kSbSocketAddressTypeIpv4, kSbSocketAddressTypeIpv6), GetSbSocketAddressTypeName); -#else -INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, - SbSocketWaiterAddTest, - ::testing::Values(kSbSocketAddressTypeIpv4), - GetSbSocketAddressTypeName); -#endif } // namespace } // namespace nplb diff --git a/starboard/nplb/socket_waiter_remove_test.cc b/starboard/nplb/socket_waiter_remove_test.cc index 824329e740b8..07d5fb47cb9c 100644 --- a/starboard/nplb/socket_waiter_remove_test.cc +++ b/starboard/nplb/socket_waiter_remove_test.cc @@ -94,18 +94,11 @@ TEST_P(SbSocketWaiterRemoveTest, RainyDayAlreadyRemoved) { EXPECT_TRUE(SbSocketWaiterDestroy(waiter)); } -#if SB_HAS(IPV6) INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, SbSocketWaiterRemoveTest, ::testing::Values(kSbSocketAddressTypeIpv4, kSbSocketAddressTypeIpv6), GetSbSocketAddressTypeName); -#else -INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, - SbSocketWaiterRemoveTest, - ::testing::Values(kSbSocketAddressTypeIpv4), - GetSbSocketAddressTypeName); -#endif } // namespace } // namespace nplb diff --git a/starboard/nplb/socket_waiter_wait_test.cc b/starboard/nplb/socket_waiter_wait_test.cc index 487ff085d4c0..2987eaf16670 100644 --- a/starboard/nplb/socket_waiter_wait_test.cc +++ b/starboard/nplb/socket_waiter_wait_test.cc @@ -254,7 +254,6 @@ TEST_F(SbSocketWaiterWaitTest, RainyDayInvalidWaiter) { WaitShouldNotBlock(kSbSocketWaiterInvalid); } -#if SB_HAS(IPV6) INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, SbSocketWaiterWaitTest, ::testing::Values(kSbSocketAddressTypeIpv4, @@ -268,18 +267,6 @@ INSTANTIATE_TEST_CASE_P( std::make_pair(kSbSocketAddressTypeIpv6, kSbSocketAddressTypeIpv6), std::make_pair(kSbSocketAddressTypeIpv6, kSbSocketAddressTypeIpv4)), GetSbSocketAddressTypePairName); -#else -INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, - SbSocketWaiterWaitTest, - ::testing::Values(kSbSocketAddressTypeIpv4), - GetSbSocketAddressTypeName); -INSTANTIATE_TEST_CASE_P( - SbSocketAddressTypes, - PairSbSocketWaiterWaitTest, - ::testing::Values(std::make_pair(kSbSocketAddressTypeIpv4, - kSbSocketAddressTypeIpv4)), - GetSbSocketAddressTypePairName); -#endif } // namespace } // namespace nplb diff --git a/starboard/nplb/socket_waiter_wait_timed_test.cc b/starboard/nplb/socket_waiter_wait_timed_test.cc index 32681b0bb588..fb459ea326a1 100644 --- a/starboard/nplb/socket_waiter_wait_timed_test.cc +++ b/starboard/nplb/socket_waiter_wait_timed_test.cc @@ -125,7 +125,6 @@ TEST(SbSocketWaiterWaitTimedTest, RainyDayInvalidWaiter) { TimedWaitShouldNotBlock(kSbSocketWaiterInvalid, kSocketTimeout); } -#if SB_HAS(IPV6) INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, SbSocketWaiterWaitTimedTest, ::testing::Values(kSbSocketAddressTypeIpv4, @@ -139,18 +138,6 @@ INSTANTIATE_TEST_CASE_P( std::make_pair(kSbSocketAddressTypeIpv6, kSbSocketAddressTypeIpv6), std::make_pair(kSbSocketAddressTypeIpv6, kSbSocketAddressTypeIpv4)), GetSbSocketAddressTypePairName); -#else -INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes, - SbSocketWaiterWaitTimedTest, - ::testing::Values(kSbSocketAddressTypeIpv4), - GetSbSocketAddressTypeName); -INSTANTIATE_TEST_CASE_P( - SbSocketAddressTypes, - PairSbSocketWaiterWaitTimedTest, - ::testing::Values(std::make_pair(kSbSocketAddressTypeIpv4, - kSbSocketAddressTypeIpv4)), - GetSbSocketAddressTypePairName); -#endif } // namespace } // namespace nplb diff --git a/starboard/nplb/socket_wrapper_test.cc b/starboard/nplb/socket_wrapper_test.cc index f34e4ea0861d..21750f59666d 100644 --- a/starboard/nplb/socket_wrapper_test.cc +++ b/starboard/nplb/socket_wrapper_test.cc @@ -81,7 +81,6 @@ TEST_P(PairSbSocketWrapperTest, SunnyDay) { } } -#if SB_HAS(IPV6) INSTANTIATE_TEST_CASE_P( SbSocketAddressTypes, PairSbSocketWrapperTest, @@ -90,14 +89,6 @@ INSTANTIATE_TEST_CASE_P( std::make_pair(kSbSocketAddressTypeIpv6, kSbSocketAddressTypeIpv6), std::make_pair(kSbSocketAddressTypeIpv6, kSbSocketAddressTypeIpv4)), GetSbSocketAddressTypePairName); -#else -INSTANTIATE_TEST_CASE_P( - SbSocketAddressTypes, - PairSbSocketWrapperTest, - ::testing::Values(std::make_pair(kSbSocketAddressTypeIpv4, - kSbSocketAddressTypeIpv4)), - GetSbSocketAddressTypePairName); -#endif } // namespace } // namespace nplb diff --git a/starboard/raspi/shared/configuration_public.h b/starboard/raspi/shared/configuration_public.h index 62822b5dafbe..08c4179be1ad 100644 --- a/starboard/raspi/shared/configuration_public.h +++ b/starboard/raspi/shared/configuration_public.h @@ -43,9 +43,4 @@ #define SB_IS_WCHAR_T_UNSIGNED 1 #endif -// --- Network Configuration ------------------------------------------------- - -// Specifies whether this platform supports IPV6. -#define SB_HAS_IPV6 1 - #endif // STARBOARD_RASPI_SHARED_CONFIGURATION_PUBLIC_H_ diff --git a/starboard/shared/linux/socket_get_interface_address.cc b/starboard/shared/linux/socket_get_interface_address.cc index e0268ff241f1..8348cc268177 100644 --- a/starboard/shared/linux/socket_get_interface_address.cc +++ b/starboard/shared/linux/socket_get_interface_address.cc @@ -50,7 +50,6 @@ bool IsAnyAddress(const SbSocketAddress& address) { case kSbSocketAddressTypeIpv4: return (address.address[0] == 0 && address.address[1] == 0 && address.address[2] == 0 && address.address[3] == 0); -#if SB_HAS(IPV6) case kSbSocketAddressTypeIpv6: { bool found_nonzero = false; for (std::size_t i = 0; i != kIPv6AddressSize; ++i) { @@ -58,7 +57,6 @@ bool IsAnyAddress(const SbSocketAddress& address) { } return !found_nonzero; } -#endif default: SB_NOTREACHED() << "Invalid address type " << address.type; break; @@ -152,11 +150,9 @@ bool GetNetMaskForInterfaceAddress(const SbSocketAddress& interface_address, case kSbSocketAddressTypeIpv4: return GetNetmaskForInterfaceAddress(interface_address, out_netmask); -#if SB_HAS(IPV6) case kSbSocketAddressTypeIpv6: return GetNetmaskForInterfaceAddress(interface_address, out_netmask); -#endif default: SB_NOTREACHED() << "Invalid address type " << interface_address.type; break; @@ -214,7 +210,6 @@ bool FindIPv4InterfaceIP(SbSocketAddress* out_interface_ip, return success; } -#if SB_HAS(IPV6) bool IsUniqueLocalAddress(const unsigned char ip[16]) { // Unique Local Addresses are in fd08::/8. return ip[0] == 0xfd && ip[1] == 0x08; @@ -310,7 +305,6 @@ bool FindIPv6InterfaceIP(SbSocketAddress* out_interface_ip, return true; } -#endif bool FindInterfaceIP(const SbSocketAddressType type, SbSocketAddress* out_interface_ip, @@ -318,10 +312,8 @@ bool FindInterfaceIP(const SbSocketAddressType type, switch (type) { case kSbSocketAddressTypeIpv4: return FindIPv4InterfaceIP(out_interface_ip, out_netmask); -#if SB_HAS(IPV6) case kSbSocketAddressTypeIpv6: return FindIPv6InterfaceIP(out_interface_ip, out_netmask); -#endif default: SB_NOTREACHED() << "Invalid socket address type " << type; } @@ -359,13 +351,9 @@ bool SbSocketGetInterfaceAddress(const SbSocketAddress* const destination, } if (destination == NULL) { -#if SB_HAS(IPV6) // Return either a v4 or a v6 address. Per spec. return (FindIPv4InterfaceIP(out_source_address, out_netmask) || FindIPv6InterfaceIP(out_source_address, out_netmask)); -#else - return FindIPv4InterfaceIP(out_source_address, out_netmask); -#endif } else if (IsAnyAddress(*destination)) { return FindInterfaceIP(destination->type, out_source_address, out_netmask); diff --git a/starboard/shared/posix/socket_bind.cc b/starboard/shared/posix/socket_bind.cc index f80f7724bb16..01fbe9ea3ddf 100644 --- a/starboard/shared/posix/socket_bind.cc +++ b/starboard/shared/posix/socket_bind.cc @@ -47,7 +47,6 @@ SbSocketError SbSocketBind(SbSocket socket, return (socket->error = sbposix::TranslateSocketErrno(EAFNOSUPPORT)); } -#if SB_HAS(IPV6) // When binding to the IPV6 any address, ensure that the IPV6_V6ONLY flag is // off to allow incoming IPV4 connections on the same socket. // See https://www.ietf.org/rfc/rfc3493.txt for details. @@ -59,7 +58,6 @@ SbSocketError SbSocketBind(SbSocket socket, socket->error = kSbSocketOk; } } -#endif int result = HANDLE_EINTR( bind(socket->socket_fd, sock_addr.sockaddr(), sock_addr.length)); diff --git a/starboard/shared/posix/socket_internal.cc b/starboard/shared/posix/socket_internal.cc index 11d906068b82..73cf5040707a 100644 --- a/starboard/shared/posix/socket_internal.cc +++ b/starboard/shared/posix/socket_internal.cc @@ -29,11 +29,9 @@ namespace { const socklen_t kAddressLengthIpv4 = 4; const socklen_t kAddressStructLengthIpv4 = static_cast(sizeof(struct sockaddr_in)); -#if SB_HAS(IPV6) const socklen_t kAddressLengthIpv6 = 16; const socklen_t kAddressStructLengthIpv6 = static_cast(sizeof(struct sockaddr_in6)); -#endif } // namespace SbSocketError TranslateSocketErrno(int error) { @@ -123,7 +121,6 @@ bool SockAddr::FromSbSocketAddress(const SbSocketAddress* address) { memcpy(&addr->sin_addr, address->address, kAddressLengthIpv4); break; } -#if SB_HAS(IPV6) case kSbSocketAddressTypeIpv6: { struct sockaddr_in6* addr6 = sockaddr_in6(); length = kAddressStructLengthIpv6; @@ -133,7 +130,6 @@ bool SockAddr::FromSbSocketAddress(const SbSocketAddress* address) { memcpy(&addr6->sin6_addr, address->address, kAddressLengthIpv6); break; } -#endif default: SB_NOTREACHED() << "Unrecognized address type: " << address->type; return false; @@ -147,13 +143,9 @@ bool SockAddr::ToSbSocketAddress(SbSocketAddress* out_address) const { return false; } -// Check that we have been properly initialized. -#if SB_HAS(IPV6) + // Check that we have been properly initialized. SB_DCHECK(length == kAddressStructLengthIpv4 || length == kAddressStructLengthIpv6); -#else - SB_DCHECK(length == kAddressStructLengthIpv4); -#endif if (family() == AF_INET) { const struct sockaddr_in* addr = sockaddr_in(); @@ -168,7 +160,6 @@ bool SockAddr::ToSbSocketAddress(SbSocketAddress* out_address) const { return true; } -#if SB_HAS(IPV6) if (family() == AF_INET6) { const struct sockaddr_in6* addr6 = sockaddr_in6(); if (length < kAddressStructLengthIpv6) { @@ -181,7 +172,6 @@ bool SockAddr::ToSbSocketAddress(SbSocketAddress* out_address) const { out_address->type = kSbSocketAddressTypeIpv6; return true; } -#endif SB_NOTREACHED() << "Unrecognized address family: " << family(); return false; @@ -199,14 +189,12 @@ bool SockAddr::FromSockaddr(const struct sockaddr* sock_addr) { *sockaddr_in() = *addr; length = static_cast(sizeof(*addr)); return true; -#if SB_HAS(IPV6) } else if (family == AF_INET6) { const struct sockaddr_in6* addr = reinterpret_cast(sock_addr); *sockaddr_in6() = *addr; length = static_cast(sizeof(*addr)); return true; -#endif } SB_LOG(WARNING) << "Unrecognized address family: " << family; diff --git a/starboard/shared/posix/socket_is_ipv6_supported.cc b/starboard/shared/posix/socket_is_ipv6_supported.cc index 9675b50c39d6..b65583df78dc 100644 --- a/starboard/shared/posix/socket_is_ipv6_supported.cc +++ b/starboard/shared/posix/socket_is_ipv6_supported.cc @@ -15,5 +15,5 @@ #include "starboard/socket.h" bool SbSocketIsIpv6Supported() { - return SB_HAS_IPV6; + return true; } diff --git a/starboard/stub/configuration_public.h b/starboard/stub/configuration_public.h index 80f29bfa6aa9..832fa1b2ca08 100644 --- a/starboard/stub/configuration_public.h +++ b/starboard/stub/configuration_public.h @@ -48,9 +48,4 @@ #define SB_IS_WCHAR_T_UNSIGNED 1 #endif -// --- Network Configuration ------------------------------------------------- - -// Specifies whether this platform supports IPV6. -#define SB_HAS_IPV6 1 - #endif // STARBOARD_STUB_CONFIGURATION_PUBLIC_H_