changeset 2090:b019cdae32dd

6916922: (sctp) SO_RCVBUF & SO_SNDBUF returns twice the value set Reviewed-by: alanb
author chegar
date Fri, 15 Jan 2010 16:31:16 +0000
parents 074f79397dda
children 64f7b789aecc
files src/solaris/native/sun/nio/ch/SctpNet.c test/com/sun/nio/sctp/SctpChannel/SocketOptionTests.java
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/sun/nio/ch/SctpNet.c	Fri Jan 15 09:58:48 2010 -0500
+++ b/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/test/com/sun/nio/sctp/SctpChannel/SocketOptionTests.java	Fri Jan 15 09:58:48 2010 -0500
+++ b/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);