No public description PiperOrigin-RevId: 885840090
diff --git a/quiche/quic/core/io/socket.h b/quiche/quic/core/io/socket.h index 8debff7..8191251 100644 --- a/quiche/quic/core/io/socket.h +++ b/quiche/quic/core/io/socket.h
@@ -163,6 +163,8 @@ // Same as Send() except a specific address (`peer_address`) is specified for // where to send the data to. Typically used for non-connected sockets. +// When `fd` is a raw IP socket, it's caller's responsibility to set +// `peer_address.port()` to 0, otherwise the send operation may fail. absl::StatusOr<absl::string_view> SendTo(SocketFd fd, const QuicSocketAddress& peer_address, absl::string_view buffer);
diff --git a/quiche/quic/core/io/socket_test.cc b/quiche/quic/core/io/socket_test.cc index 4b89940..e94d6d6 100644 --- a/quiche/quic/core/io/socket_test.cc +++ b/quiche/quic/core/io/socket_test.cc
@@ -324,8 +324,7 @@ QUICHE_EXPECT_OK(socket_api::Close(socket)); } -// TODO(b/485901584): Very flaky -TEST(SocketTest, DISABLED_SendToForRaw) { +TEST(SocketTest, SendToForRaw) { SocketFd socket = CreateTestRawSocket(/*blocking=*/true); if (socket == kInvalidSocketFd) { GTEST_SKIP(); @@ -341,7 +340,7 @@ QuicSocketAddress server_address(localhost_address, /*port=*/56362); std::string packet = CreateUdpPacket(client_address, server_address, "foo"); absl::StatusOr<absl::string_view> result = socket_api::SendTo( - socket, QuicSocketAddress(localhost_address, /*port=*/56362), packet); + socket, QuicSocketAddress(localhost_address, /*port=*/0), packet); // Expect at least some data to be sent successfully. QUICHE_ASSERT_OK(result.status()); @@ -350,8 +349,7 @@ QUICHE_EXPECT_OK(socket_api::Close(socket)); } -// TODO(b/485901584): Very flaky -TEST(SocketTest, DISABLED_SendToForRawWithIpHeader) { +TEST(SocketTest, SendToForRawWithIpHeader) { SocketFd socket = CreateTestRawSocket(/*blocking=*/true); if (socket == kInvalidSocketFd) { GTEST_SKIP(); @@ -368,7 +366,7 @@ CreateIpPacket(client_address.host(), server_address.host(), CreateUdpPacket(client_address, server_address, "foo")); absl::StatusOr<absl::string_view> result = socket_api::SendTo( - socket, QuicSocketAddress(localhost_address, /*port=*/56362), packet); + socket, QuicSocketAddress(localhost_address, /*port=*/0), packet); // Expect at least some data to be sent successfully. QUICHE_ASSERT_OK(result.status());