6916922: (sctp) SO_RCVBUF & SO_SNDBUF returns twice the value set
Reviewed-by: alanb
--- a/jdk/src/solaris/native/sun/nio/ch/SctpNet.c Fri Jan 15 09:58:48 2010 -0500
+++ b/jdk/src/solaris/native/sun/nio/ch/SctpNet.c Fri Jan 15 16:31:16 2010 +0000
@@ -484,7 +484,7 @@
arglen = sizeof(arg);
}
- if (setsockopt(fd, klevel, kopt, parg, arglen) < 0) {
+ if (NET_SetSockOpt(fd, klevel, kopt, parg, arglen) < 0) {
JNU_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
"sun_nio_ch_SctpNet.setIntOption0");
}
@@ -517,7 +517,7 @@
arglen = sizeof(result);
}
- if (getsockopt(fd, klevel, kopt, arg, &arglen) < 0) {
+ if (NET_GetSockOpt(fd, klevel, kopt, arg, &arglen) < 0) {
JNU_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
"sun.nio.ch.Net.getIntOption");
return -1;
--- a/jdk/test/com/sun/nio/sctp/SctpChannel/SocketOptionTests.java Fri Jan 15 09:58:48 2010 -0500
+++ b/jdk/test/com/sun/nio/sctp/SctpChannel/SocketOptionTests.java Fri Jan 15 16:31:16 2010 +0000
@@ -104,7 +104,9 @@
sc.setOption(SCTP_NODELAY, true);
checkOption(sc, SCTP_NODELAY, true);
sc.setOption(SO_SNDBUF, 16*1024);
+ checkOption(sc, SO_SNDBUF, 16*1024);
sc.setOption(SO_RCVBUF, 16*1024);
+ checkOption(sc, SO_RCVBUF, 16*1024);
checkOption(sc, SO_LINGER, -1); /* default should be negative */
sc.setOption(SO_LINGER, 2000);
checkOption(sc, SO_LINGER, 2000);