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:
parent
9852a6f75c
commit
c8c4d8377a
@ -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
|
||||
*/
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user