Skip to content

Commit

Permalink
Fix for ipv6 socket test where ipv6 doesn't work. (youtube#4274)
Browse files Browse the repository at this point in the history
Since youtube#4270, UDP socket connections are no longer
silently ignored. Starboard can not return ERR_ADDRESS_UNREACHABLE and
will instead return ERR_FAILED.

This changes UDPSocketTest.ClientGetLocalPeerAddresses to allow that
return value for ipv6 connections.

b/373726636
b/205134049
  • Loading branch information
jellefoks authored Oct 16, 2024
1 parent 7e04f7f commit 8a9e441
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion base/task/single_thread_task_executor_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ TEST_P(SingleThreadTaskExecutorTypedTest, RunLoopQuitOrderAfter) {
// On Linux, the pipe buffer size is 64KiB by default. The bug caused one byte
// accumulated in the pipe per two posts, so we should repeat 128K times to
// reproduce the bug.
#if BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS) || defined(STARBOARD)
// TODO(crbug.com/1188497): This test is unreasonably slow on CrOS and flakily
// times out (100x slower than other platforms which take < 1s to complete
// it).
Expand Down
6 changes: 6 additions & 0 deletions net/socket/udp_socket_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,13 @@ TEST_F(UDPSocketTest, ClientGetLocalPeerAddresses) {
UDPClientSocket client(DatagramSocket::DEFAULT_BIND, nullptr,
NetLogSource());
int rv = client.Connect(remote_address);
#if defined(STARBOARD)
// Starboard currently can not return ERR_ADDRESS_UNREACHABLE and instead
// will return ERR_FAILED.
if (test.may_fail && (rv == ERR_ADDRESS_UNREACHABLE || rv == ERR_FAILED)) {
#else
if (test.may_fail && rv == ERR_ADDRESS_UNREACHABLE) {
#endif
// Connect() may return ERR_ADDRESS_UNREACHABLE for IPv6
// addresses if IPv6 is not configured.
continue;
Expand Down
6 changes: 0 additions & 6 deletions starboard/shared/win32/socket_send_to.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ int SbSocketSendTo(SbSocket socket,
socket->error = sbwin32::TranslateSocketErrorStatus(last_error);
return -1;
} else if (socket->protocol == kSbSocketProtocolUdp) {
if (!destination) {
SB_DLOG(FATAL) << "No destination passed to UDP send.";
socket->error = kSbSocketErrorFailed;
return -1;
}

sbwin32::SockAddr sock_addr;
const sockaddr* sockaddr = nullptr;
socklen_t sockaddr_length = 0;
Expand Down

0 comments on commit 8a9e441

Please sign in to comment.