Ivan Gerasimov | 21 Sep 14:19 2014

RFR 8058824: Drop TwoStacks socket implementation in jdk9 [win] - Part I


Here is a proposal for the first step in cleaning up the TwoStacks 
socket implementation.
It is proposed to drom IPv6 support in the implementation of 
TwoStacksPlainSocketImpl class (so formally, it's no more Two Stacks).
Therefore, this class will only be used when the user explicitly 
requests IPv4 only configuration through setting 
java.net.preferIPv4Stack option.

The fix mostly consists of removal, so it should be relatively easy to 

All the jdk_net tests pass.

BUGURL: https://bugs.openjdk.java.net/browse/JDK-8058824
WEBREV: http://cr.openjdk.java.net/~igerasim/8058824/0/webrev/

Sincerely yours,

Chris Hegarty | 11 Sep 15:42 2014

RFR [9] 8058216: NetworkInterface.getHardwareAddress can return zero length byte array when run with preferIPv4Stack

A small issue was found when running JCK tests on modern Windows platforms, that have IPv6 enabled, but
forced to run with the IPv4 Stack, -Djava.net.preferIPv4Stack=true.
NetworkInterface.getHardwareAddress() can return a zero length byte array, where is should, and is
specified to, return null.

The solution is to only create the byte array if the physical address is known. Running an existing
regression test with -Djava.net.preferIPv4Stack=true covers this issue.

diff -r 5cf954b229fe src/java.base/windows/native/libnet/NetworkInterface.c
--- a/src/java.base/windows/native/libnet/NetworkInterface.c    Thu Sep 11 15:13:37 2014 +0400
+++ b/src/java.base/windows/native/libnet/NetworkInterface.c    Thu Sep 11 14:34:11 2014 +0100
 <at>  <at>  -990,9 +990,11  <at>  <at> 
       case MIB_IF_TYPE_FDDI:
       case IF_TYPE_IEEE80211:
         len = ifRowP->dwPhysAddrLen;
-        ret = (*env)->NewByteArray(env, len);
-        if (!IS_NULL(ret)) {
-          (*env)->SetByteArrayRegion(env, ret, 0, len, (jbyte *) ifRowP->bPhysAddr);
+        if (len > 0) {
+          ret = (*env)->NewByteArray(env, len);
+          if (!IS_NULL(ret)) {
+            (*env)->SetByteArrayRegion(env, ret, 0, len, (jbyte *) ifRowP->bPhysAddr);
+          }
diff -r 5cf954b229fe test/java/net/NetworkInterface/Test.java
--- a/test/java/net/NetworkInterface/Test.java  Thu Sep 11 15:13:37 2014 +0400
+++ b/test/java/net/NetworkInterface/Test.java  Thu Sep 11 14:34:11 2014 +0100
 <at>  <at>  -23,6 +23,8  <at>  <at> 
(Continue reading)

Ivan Gerasimov | 9 Sep 13:03 2014

RFR [7010989]: Duplicate closure of file descriptors leads to unexpected and incorrect closure of sockets


In the implementation of TwoStack sockets on Windows there's is a 
possibility of trying to close the sockets twice in the case of a failure.
TwoStack implementation isn't the default one, but it still can be used 
with jdk7u/8u on old platforms.

Would you please help review the fix?

BUGURL: https://bugs.openjdk.java.net/browse/JDK-7010989
WEBREV: http://cr.openjdk.java.net/~igerasim/7010989/0/webrev/

Sincerely yours,

Michael McMahon | 26 Aug 16:01 2014

RFR 8056065: sun/net/www/protocol/http/RedirectOnPost.java failing.

Could I get the following small change reviewed please?

One file was missed from my earlier change to SimpleSSLContext



Seán Coffey | 22 Aug 17:24 2014

RFR : 8032808, 8047186, 8029607, 8048212 - SO_FLOW_SLA support for solaris, Set TOS in IPv6 header

I'd like to backport these fixes into the jdk7u-dev codeline. They're already in jdk8u-dev.

https://bugs.openjdk.java.net/browse/JDK-8032808 - SO_FLOW_SLA support for solaris
https://bugs.openjdk.java.net/browse/JDK-8047186 - Exception handling change linked to above

https://bugs.openjdk.java.net/browse/JDK-8029607 - Set TOS in IPv6 header
https://bugs.openjdk.java.net/browse/JDK-8048212 - Testcase failure with above fix

some of the changes are quite different from jdk8u in that the make system is different. I've put some of the main differences in bullet points :

* new makefiles to capture the jdk/net classes
* Different javadoc makefile layout for 7u
* static src/share/native/java/net/jdk_net_SocketFlow.h header file (dynamic in jdk8u)
* Alter src/share/classes/jdk/net/Sockets.java :
  - throw new Error(e); instead of throw new InternalError(e); (older API)
* removal of lambda use in testcase

webrev : http://cr.openjdk.java.net/~coffeys/webrev.sla_tos/webrev/
CCC for 7u has been submitted.


Mark Sheppard | 21 Aug 18:02 2014

RFR: JDK-8044306 - java.net.Inet4AddressImpl.getLocalHostName() uses IPv6 rather than IPv4

   please oblige and review the small change

to address the issue raised in

hints.ai_family is assigned AF_INET rather than AF_UNSPEC
as the native function
is part of an IPv4 call flow, such that AF_UNSPEC allows
an IPv6 data to be retrieved as highlighted in bug report


Michael McMahon | 21 Aug 13:33 2014

RFR 8055747: Move SimpleSSLContext to jdk/testlibrary

Before I push the other change to HttpsURLConnection, I'd like
to make this change to stop the proliferation of binary testkeys files
in the test tree and make the SimpleSSLContext class more accessible.



Michael McMahon | 20 Aug 15:02 2014

RFR: 8055299 HttpsURLConnection.equals() broken

This is the recently reported fix to HttpsURLConnection.equals


The fix includes a test. Not shown in the webrev is java key store
file called testkeys, which is copied from another location
in the test tree and is to be installed in the same directory
as the new test.


Claes Redestad | 13 Aug 16:02 2014

RFR(S): 8055032: Improve numerical parsing in java.net and sun.net


can I have a review for this patch to take advantage of offset-based 
parseInt methods added in
8041972 for java.net/sun.net classes?

bug: https://bugs.openjdk.java.net/browse/JDK-8055032
webrev: http://cr.openjdk.java.net/~redestad/8055032/webrev.0

This causes fewer temporary String objects to be allocated and shows a 
direct throughput improvement
in micros (1.2x in java.net.URLDecoder#decode and 
sun.net.www.ParseUtil#decode, for example)


Mark Sheppard | 7 Aug 20:15 2014

RFR: JDK-8054118 - java/net/ipv6tests/UdpTest.java failed intermittently

   please oblige and review the following fix

to address the issue raised in

The Windows test environment has a Teredo interface.
This oscillates between being configured with IPv6 and not been configured.
The configured state is transient. When configured its IPv6 is retrieved as
first local ipv6 address. As such, it can happen that during the test the
interface is disabled, and the test will fail with the report Socket 
receive timeout.

This fix removes the Teredo interface from the testing scenario, so that 
a more stable interface
will be used.


Wang Weijun | 1 Aug 07:39 2014

nameservers in solaris/.../ResolverConfigurationImpl not static

There are 2 sun.net.dns.ResolverConfigurationImpl implementations. The cached searchlist and
nameservers in the solaris version are instance fields and those in windows are static. The cache
mechanism in both is guarded by static fields changed and lastRefresh. Therefore it seems the solaris
searchlist/nameservers should also be static.