6916922: (sctp) SO_RCVBUF & SO_SNDBUF returns twice the value set
authorchegar
Fri, 15 Jan 2010 16:31:16 +0000
changeset 4675 68f287672813
parent 4674 e842c85ac8f4
child 4676 4cdcce877ba7
6916922: (sctp) SO_RCVBUF & SO_SNDBUF returns twice the value set Reviewed-by: alanb
jdk/src/solaris/native/sun/nio/ch/SctpNet.c
jdk/test/com/sun/nio/sctp/SctpChannel/SocketOptionTests.java
--- 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);