jdk/src/solaris/classes/sun/nio/ch/SctpNet.java
changeset 7545 409091945418
parent 5506 202f599c92aa
child 7668 d4a77089c587
--- a/jdk/src/solaris/classes/sun/nio/ch/SctpNet.java	Thu Dec 09 13:01:14 2010 -0500
+++ b/jdk/src/solaris/classes/sun/nio/ch/SctpNet.java	Fri Dec 10 10:47:21 2010 +0000
@@ -43,7 +43,7 @@
 
     /* -- Miscellaneous SCTP utilities -- */
 
-    static boolean bindxIPv4MappedAddresses() {
+    private static boolean IPv4MappedAddresses() {
         if ("SunOS".equals(osName)) {
             /* Solaris supports IPv4Mapped Addresses with bindx */
             return true;
@@ -87,7 +87,7 @@
     static void bindx(int fd, InetAddress[] addrs, int port, boolean add)
             throws IOException {
         bindx(fd, addrs, port, addrs.length, add,
-                bindxIPv4MappedAddresses());
+                IPv4MappedAddresses());
     }
 
     static Set<SocketAddress> getLocalAddresses(int fd)
@@ -145,11 +145,16 @@
             InetSocketAddress netAddr = (InetSocketAddress)addr;
 
             if (name.equals(SCTP_PRIMARY_ADDR)) {
-                setPrimAddrOption0(fd, assocId,
-                        netAddr.getAddress(), netAddr.getPort());
+                setPrimAddrOption0(fd,
+                                   assocId,
+                                   netAddr.getAddress(),
+                                   netAddr.getPort());
             } else {
-                setPeerPrimAddrOption0(fd, assocId,
-                        netAddr.getAddress(), netAddr.getPort());
+                setPeerPrimAddrOption0(fd,
+                                       assocId,
+                                       netAddr.getAddress(),
+                                       netAddr.getPort(),
+                                       IPv4MappedAddresses());
             }
         } else if (name.equals(SCTP_DISABLE_FRAGMENTS) ||
             name.equals(SCTP_EXPLICIT_COMPLETE) ||
@@ -290,7 +295,7 @@
             int port) throws IOException;
 
     static native void setPeerPrimAddrOption0(int fd, int assocId,
-            InetAddress ia, int port) throws IOException;
+            InetAddress ia, int port, boolean preferIPv6) throws IOException;
 
     static native SocketAddress getPrimAddrOption0(int fd, int assocId)
             throws IOException;