Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8250886: java/net/DatagramSocket/SendReceiveMaxSize.java fails in tim…
…eout

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
  • Loading branch information
pconcannon committed Aug 7, 2020
1 parent e05a51a commit 61108f2409d9424ec05ea768737949300bf2ad18
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
@@ -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) {
@@ -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
*/

0 comments on commit 61108f2

Please sign in to comment.