Hi Christopher, > This method was added as part of the changes for 4868820: "IPv6 support > for Windows XP and 2003 server", back in 1.5. But I cannot see anywhere > that it is called, or as you said even implemented, even when it was > originally added. I suspect that it was left over from some redesign > when adding the IPv6 support. > > I actually noticed this went adding support for the dual TCP/IP stack in > vista, DualStackPlainSocketImpl, and even added a comment to remind me > to remove it!
The methods java.net.NetworkInterface.getSubnet0() and java.net.NetworkInterface.getBroadcast0() seem to be affected by the same problem. May I propose the attached patch to fix? /Roman -- Dipl.-Inform. (FH) Roman Kennke, Software Engineer, http://kennke.org aicas Allerton Interworks Computer Automated Systems GmbH Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany http://www.aicas.com * Tel: +49-721-663 968-0 USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe Geschäftsführer: Dr. James J. Hunt
Index: j2se/src/share/classes/java/net/AbstractPlainSocketImpl.java =================================================================== --- j2se/src/share/classes/java/net/AbstractPlainSocketImpl.java (Revision 254) +++ j2se/src/share/classes/java/net/AbstractPlainSocketImpl.java (Arbeitskopie) @@ -665,7 +665,6 @@ abstract void socketSetOption(int cmd, boolean on, Object value) throws SocketException; abstract int socketGetOption(int opt, Object iaContainerObj) throws SocketException; - abstract int socketGetOption1(int opt, Object iaContainerObj, FileDescriptor fd) throws SocketException; abstract void socketSendUrgentData(int data) throws IOException; Index: j2se/src/share/classes/java/net/NetworkInterface.java =================================================================== --- j2se/src/share/classes/java/net/NetworkInterface.java (Revision 254) +++ j2se/src/share/classes/java/net/NetworkInterface.java (Arbeitskopie) @@ -41,7 +41,7 @@ * * @since 1.4 */ -public final class NetworkInterface { +ptpublic final class NetworkInterface { private String name; private String displayName; private int index; @@ -425,8 +425,6 @@ return virtual; } - private native static long getSubnet0(String name, int ind) throws SocketException; - private native static Inet4Address getBroadcast0(String name, int ind) throws SocketException; private native static boolean isUp0(String name, int ind) throws SocketException; private native static boolean isLoopback0(String name, int ind) throws SocketException; private native static boolean supportsMulticast0(String name, int ind) throws SocketException; Index: j2se/src/windows/classes/java/net/TwoStacksPlainSocketImpl.java =================================================================== --- j2se/src/windows/classes/java/net/TwoStacksPlainSocketImpl.java (Revision 254) +++ j2se/src/windows/classes/java/net/TwoStacksPlainSocketImpl.java (Arbeitskopie) @@ -200,8 +200,5 @@ native int socketGetOption(int opt, Object iaContainerObj) throws SocketException; - native int socketGetOption1(int opt, Object iaContainerObj, FileDescriptor fd) - throws SocketException; - native void socketSendUrgentData(int data) throws IOException; } Index: j2se/src/windows/classes/java/net/DualStackPlainSocketImpl.java =================================================================== --- j2se/src/windows/classes/java/net/DualStackPlainSocketImpl.java (Revision 254) +++ j2se/src/windows/classes/java/net/DualStackPlainSocketImpl.java (Arbeitskopie) @@ -219,9 +219,6 @@ return value; } - int socketGetOption1(int opt, Object iaContainerObj, FileDescriptor fd) - throws SocketException {return 0;} // un-implemented REMOVE - void socketSendUrgentData(int data) throws IOException { int nativefd = checkAndReturnNativeFD(); sendOOB(nativefd, data); Index: j2se/src/windows/classes/java/net/PlainSocketImpl.java =================================================================== --- j2se/src/windows/classes/java/net/PlainSocketImpl.java (Revision 254) +++ j2se/src/windows/classes/java/net/PlainSocketImpl.java (Arbeitskopie) @@ -305,11 +305,6 @@ return impl.socketGetOption(opt, iaContainerObj); } - int socketGetOption1(int opt, Object iaContainerObj, FileDescriptor fd) - throws SocketException { - return impl.socketGetOption1(opt, iaContainerObj, fd); - } - void socketSendUrgentData(int data) throws IOException { impl.socketSendUrgentData(data); } Index: j2se/src/solaris/classes/java/net/PlainSocketImpl.java =================================================================== --- j2se/src/solaris/classes/java/net/PlainSocketImpl.java (Revision 254) +++ j2se/src/solaris/classes/java/net/PlainSocketImpl.java (Arbeitskopie) @@ -77,9 +77,6 @@ native int socketGetOption(int opt, Object iaContainerObj) throws SocketException; - native int socketGetOption1(int opt, Object iaContainerObj, FileDescriptor fd) - throws SocketException; - native void socketSendUrgentData(int data) throws IOException; }