src/java.base/share/classes/sun/nio/ch/Net.java
branchunixdomainchannels
changeset 59004 84e08e00c29c
parent 58848 c3df0f8b6d93
parent 59000 612c58965775
child 59076 998df1368cca
--- a/src/java.base/share/classes/sun/nio/ch/Net.java	Mon Nov 11 10:38:24 2019 +0000
+++ b/src/java.base/share/classes/sun/nio/ch/Net.java	Mon Nov 11 10:39:49 2019 +0000
@@ -126,6 +126,14 @@
         return canJoin6WithIPv4Group0();
     }
 
+    /**
+     * Tells whether IPV6_XXX socket options should be used on an IPv6 socket
+     * that is bound to an IPv4 address.
+     */
+    static boolean canUseIPv6OptionsWithIPv4LocalAddress() {
+        return canUseIPv6OptionsWithIPv4LocalAddress0();
+    }
+
     public static InetSocketAddress checkAddress(SocketAddress sa) {
         if (sa == null)
             throw new NullPointerException();
@@ -439,6 +447,8 @@
 
     private static native boolean canJoin6WithIPv4Group0();
 
+    private static native boolean canUseIPv6OptionsWithIPv4LocalAddress0();
+
     static FileDescriptor socket(boolean stream) throws IOException {
         return socket(UNSPEC, stream);
     }