8250886: java/net/DatagramSocket/SendReceiveMaxSize.java fails in timeout

SO_RCVBUF was previously set to match the SO_SNDBUF, however the kernel value for SO_RCVBUF is much larger. This mismatch caused the test to fail, and the fix removes this issue.

Reviewed-by: alanb, dfuchs
This commit is contained in:
Patrick Concannon 2020-08-07 20:39:10 +01:00
parent 9852a6f75c
commit c8c4d8377a
2 changed files with 2 additions and 8 deletions

View File

@ -908,13 +908,6 @@ Java_java_net_PlainDatagramSocketImpl_datagramSocketCreate(JNIEnv *env,
close(fd);
return;
}
if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF,
(char *)&arg, sizeof(arg)) < 0) {
getErrorString(errno, tmpbuf, sizeof(tmpbuf));
JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", tmpbuf);
close(fd);
return;
}
#endif /* __APPLE__ */
if (setsockopt(fd, SOL_SOCKET, SO_BROADCAST, (char*) &t, sizeof (int)) < 0) {

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 8242885
* @bug 8242885 8250886
* @summary This test verifies that on macOS, the send buffer size is configured
* by default so that none of our implementations of the UDP protocol
* will fail with a "packet too large" exception when trying to send a
@ -37,6 +37,7 @@
* @run testng/othervm -Djava.net.preferIPv4Stack=true SendReceiveMaxSize
* @run testng/othervm -Djava.net.preferIPv6Addresses=true SendReceiveMaxSize
* @run testng/othervm -Djdk.net.usePlainDatagramSocketImpl SendReceiveMaxSize
* @run testng/othervm -Djdk.net.usePlainDatagramSocketImpl -Djava.net.preferIPv4Stack=true SendReceiveMaxSize
* @run testng/othervm -Djdk.net.usePlainDatagramSocketImpl -Djava.net.preferIPv6Addresses=true SendReceiveMaxSize
*/