Artem Smotrakov | 26 Jun 19:22 2015

[9] RFR: 8129444: "socksProxyVersion" system property is ignored if Socket(Proxy) constructor is used


Please review this fix for 9.

If a socket was created with Socket(Proxy) constructor [1], then it doesn't take into account "socksProxyVersion" system property. As a result, it is not possible to use SOCKS v4 (v5 is used by default [2]). Currently the property is checked only in SocksSocketImpl.connect() method.

This fix updates SocksSocketImpl class to check "socksProxyVersion" system property when an instance is created, and in SocksSocketImpl.socksBind() method.



Mark Sheppard | 24 Jun 17:34 2015

RFR: JDK-8129507 - sun/net/www/protocol/http/ fails intermittently

    Please oblige and review the change below
which addresses the issue

This amends the url.openConnection() to take the Proxy.NO_PROXY argument,
so that a direct connection is made to test http server, thus bypassing 
any configured and enabled
http proxies on mac OS.


-------------------------- changeset -------------------

diff -r 9a66ca9b7e36 test/sun/net/www/protocol/http/
--- a/test/sun/net/www/protocol/http/      Tue Jun 23 
14:20:59 2015 -0700
+++ b/test/sun/net/www/protocol/http/      Wed Jun 24 
13:00:49 2015 +0100
 <at>  <at>  -63,7 +63,7  <at>  <at> 

              // GET Request
              URL url = new URL("http://" + 
InetAddress.getLocalHost().getHostName() + ":" + address.getPort() + 
-            HttpURLConnection uc = (HttpURLConnection)url.openConnection();
+            HttpURLConnection uc = 
              int resp = uc.getResponseCode();
              if (resp != 200)
                  throw new RuntimeException("Failed: Response code from 
GET is not 200 RSP == " + resp);
 <at>  <at>  -71,7 +71,7  <at>  <at> 
              System.out.println("Response code from GET = 200 OK");

              //POST Request
-            uc = (HttpURLConnection)url.openConnection();
+            uc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
              OutputStream os = uc.getOutputStream();

Pavel Rappo | 24 Jun 13:08 2015

[Preliminary] RFR JDK-8064925: URLConnection::getContent needs to be updated to work with modules

Hi everyone,

Could you please review my change for JDK-8064925?

The main goal is to see if the proposed spec change and the overall approach are

So what has happened in this change?

1. method now looks for
ContentHandlerFactories also via ServiceLoader mechanism.

2. Existing image & audio handlers in java.desktop has been moved from
'' package to 'sun.awt.www.content'; A ContentHandlerFactory
called 'sun.awt.www.content.MultimediaContentHandlers' has been introduced to
help ServiceLoader to discover these handlers. 

P.S. All names described in (2) are subject to agreement with awt-dev@...


Brian Burkhalter | 22 Jun 23:56 2015

[9] RFR of 8129510: java/net/Inet6Address/serialize/ should exclude testing the Teredo tunneling interface on Windows

Please review this test-only change at your convenience.

Patch: see diff below

The analysis in the comments on suggests that excluding testing of Teredo tunneling in this test might be appropriate and would produce a reliable test, hence this patch. Assuming that this is acceptable, the test should pass consistently and other issue could resolved as “Cannot Reproduce.”

Alternatively, the issue at hand may be inappropriate and applying the included diff could mask a real problem. If this latter is the consensus then this issue will be resolved as “Not an Issue."



— diff —

--- a/test/java/net/Inet6Address/serialize/
+++ b/test/java/net/Inet6Address/serialize/
<at> <at> -1,5 +1,5 <at> <at>
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
  * This code is free software; you can redistribute it and/or modify it
<at> <at> -49,6 +49,8 <at> <at>


     static boolean failed;


+    static boolean isWindows = System.getProperty("").startsWith("Windows");
     public static final int LOOPBACK_SCOPE_ID = 0;


     public static final byte[] IN6ADDR_ANY_INIT = { (byte) 0x00, (byte) 0x00,
<at> <at> -175,6 +177,13 <at> <at>
         for (Enumeration<NetworkInterface> e = NetworkInterface
                 .getNetworkInterfaces(); e.hasMoreElements();) {
             NetworkInterface netIF = e.nextElement();
+            // Skip (Windows)Teredo Tunneling Pseudo-Interface
+            if (isWindows) {
+                String dName = netIF.getDisplayName();
+                if (dName != null && dName.contains("Teredo")) {
+                    continue;
+                }
+            }
             for (Enumeration<InetAddress> iadrs = netIF.getInetAddresses(); iadrs
                     .hasMoreElements();) {
                 InetAddress iadr = iadrs.nextElement();
Brian Burkhalter | 22 Jun 22:03 2015

[9] RFR of 8129499: Structure of java/rmi/activation/rmidViaInheritedChannel tests masks exception

Please review at your convenience.


Summary: The instance variable ‘rmid’ is never initialized due to some error which occurs before the
statement which would initialize it but it is dereferenced in the finally block which causes any
exception within the try block to be suppressed.

This issue blocks obtaining further information from tests runs with respect to


Seán Coffey | 12 Jun 11:05 2015

RFR [8u-dev]:8072384:Setting IP_TOS on sockets not working on unix


I'd like to backport this fix to JDK 8u60. The port is pretty much the 
same as 9 except for modular path changes. The OptionsTest modified in 
jdk9 fix does not exist in jdk8u (test was for new API in JDK 9)

As a result, I was able to modify the jdk/net/Sockets/ test 
instead. Only real way to test this in any case is via network snoops 
and they look good.

bug report :
jdk 8u webrev :



Rob McKenna | 3 Jun 15:25 2015

RFR: 8080819: Inet4AddressImpl regression caused by JDK-7180557

Hi folks,

7180557 used getifaddrs as a way of determining the local hosts ip 
address on Mac OSX in order to fix a problem with OSX's naming system. 
When fixing this we decided to place that call before the call to 
getaddrinfo thus taking the naming system out of the equation.

Unfortunately when running over VPN we return the wrong ifaddr causing a 

The solution is to place the getifaddrs call below getaddrinfo and to 
only call it if there is an error with getaddrinfo as there was in the 
original (7180557) case.


Bobby Bissett | 1 Jun 22:14 2015

"Permission denied" using socket with IPv6

Hi all,

Can someone tell me how to diagnose this issue? I can't create a connection to another node using IPv6 because of the error below -- a short app demonstrates the problem. Everything I've found online so far is aimed at using IPv4 instead, but that's not my goal. This is on a Centos 6.6 virtual machine.

--- begin ---
[root <at> TWO test]}> java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (rhel- u79-b14)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
[root <at> TWO test]}> 
[root <at> TWO test]}> 
[root <at> TWO test]}> cat 

public class IPv6Test {

    public static void main(String[] args) {
        try {
            InetAddress ia = InetAddress.getByName("fe80::20c:29ff:fe98:9210");
            System.err.println("Opening socket for: " + ia);
            Socket socket = new Socket(ia, 7800);
            System.err.println("We have: " + socket);
        } catch (Exception e) {
[root <at> TWO test]}> 
[root <at> TWO test]}> javac && java IPv6Test
Opening socket for: /fe80:0:0:0:20c:29ff:fe98:9210 Permission denied
at Method)
at IPv6Test.main(
[root <at> TWO test]}> 
[root <at> TWO test]}> java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (rhel- u79-b14)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
--- end ---

From this node, am able to ping6 the address fine:

[root <at> TWO test]}> ping6 -I eth3 fe80::20c:29ff:fe98:9210
PING fe80::20c:29ff:fe98:9210(fe80::20c:29ff:fe98:9210) from fe80::20c:29ff:fec6:91a eth3: 56 data bytes
2 packets transmitted, 2 received, 0% packet loss, time 1023ms

I don't have selinux or a firewall running, not that I think that would matter since Java can't start to connect anyway from the message above.


Mark Sheppard | 26 May 21:34 2015

RFR: JDK-8077377 - java/net/MulticastSocket/ fails intermittently with NullPointerException

    please oblige and review the following change

to address the issue

it is possible that "stray" packets can be received in this 
MulticastSocket test, and
this results in a NPE from the NetworkInterface lookup based on the 
received address.
Change adds a test that the "from" NetworkInterface is not null.


Mark Sheppard | 26 May 21:21 2015

RFR: JDK-8041677 - java/net/MulticastSocket/TestInterfaces failed on Oracle VM Virtual Ethernet Adapter

   please oblige and review the following change

which addresses the issue

analysis has shown that the Teredo interfaces causes issue, due to its 
dynamic configuration, when included in
the test. A conditional statement excludes Teredo from the latter part 
of the test, so
the conditional is moved to the start of the while loop


Brian Toal | 22 May 08:56 2015

[PATCH] fix Inet4AddressImpl.lookupAllHostAddr returning unroutable addresses

The fix for causes a regression for Mac OSX hosts connected to a VPN (or otherwise with more than network
interface associated with the hostname).

For example, when on Cisco VPN, the ifconfig is as follows:

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
    inet netmask 0xff000000 
    inet6 ::1 prefixlen 128 
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
    ether 28:cf:e9:1a:eb:6b 
    inet6 fe80::2acf:e9ff:fe1a:eb6b%en0 prefixlen 64 scopeid 0x4 
    inet netmask 0xffffff00 broadcast
    media: autoselect
    status: active
    ether 0a:cf:e9:1a:eb:6b 
    media: autoselect
    status: inactive
    inet --> netmask 0xffffc000 
    inet6 fe80::2acf:e9ff:fe1a:eb6b%utun0 prefixlen 64 scopeid 0x6 
    inet6 fe80::49cd:21e1:4c11:721d%utun0 prefixlen 128 scopeid 0x6 

The hostname entry in DNS is associated with the utun0 interface, and and all routes go through that interface. The IP is my local wifi address, and is not used (other than to tunnel the VPN traffic when VPN is connected). Any connections to the 192.168 address, even from localhost, will fail (hang indefinitely, as all packets are dropped).

The OS getaddrinfo calls, when passed the FQDN hostname only return the 10.3 address (getaddrinfo.c attached).

Prior to the fix for JDK-7180557, getaddrinfo was being used and everything worked fine. As part of the fix, the following block was added for OSX only in the IPv4 path:

+ #ifdef MACOSX
+     /* If we're looking up the local machine, bypass DNS lookups and get
+      * address from getifaddrs.  
+      */  
+     ret = lookupIfLocalhost(env, hostname, JNI_FALSE);
+     if (ret != NULL) {
+         JNU_ReleaseStringPlatformChars(env, host, hostname);
+         return ret;
+     }
+ #endif

This code, which occurs before the usual path and applies only to localhost lookups, tries to "guess" the localaddress by interface enumeration. In the case of a VPN configuration, both en0 (192.168) and utun0 will match as they are active. So, for example, InetAddress.getAllByName("localhost FQDN"), will return both addresses. However, the getByName() call and most other code which implicitly uses the localhost will return only the first entry, which is the unroutable en0 address.

The host is configured correctly and other processes all resolve the hostname correctly. The issue is specific to this OSX workaround. 

On the IPv6 path for the same fix, the lookupIfLocalhost workaround was only applied *if* the original lookup via the usual routines failed. The attached patch follows the same approach in the IPv4 path, if the orginal lookup fails then call lookupIfLocalhost If this was applied to the IPv4 path.  The patch fixes the issue without regressing the hosts that triggered this fix.

# HG changeset patch
# User btoal
# Date 1432276472 25200
#      Thu May 21 23:34:32 2015 -0700
# Node ID 24cf7a8a8bf4f489da6b2506bcb57cb329a93593
# Parent  20e6cadfac43717a81d99daff5e769de695992cd
Only call lookupIfLocalhost if getaddrinfo call errors to avoid resolving to a incorrect address.

diff -r 20e6cadfac43 -r 24cf7a8a8bf4 src/solaris/native/java/net/Inet4AddressImpl.c
--- a/src/solaris/native/java/net/Inet4AddressImpl.c    Thu Feb 05 13:00:26 2015 +0100
+++ b/src/solaris/native/java/net/Inet4AddressImpl.c    Thu May 21 23:34:32 2015 -0700
<at> <at> -172,20 +172,19 <at> <at>
         return NULL;

-#ifdef MACOSX
-    /* If we're looking up the local machine, bypass DNS lookups and get
-     * address from getifaddrs.
-     */
-    ret = lookupIfLocalhost(env, hostname, JNI_FALSE);
-    if (ret != NULL || (*env)->ExceptionCheck(env)) {
-        JNU_ReleaseStringPlatformChars(env, host, hostname);
-        return ret;
-    }
     error = getaddrinfo(hostname, NULL, &hints, &res);

     if (error) {
+#ifdef MACOSX
+        /* If we're looking up the local machine, bypass DNS lookups and get
+         * address from getifaddrs.
+         */
+        ret = lookupIfLocalhost(env, hostname, JNI_FALSE);
+        if (ret != NULL || (*env)->ExceptionCheck(env)) {
+            JNU_ReleaseStringPlatformChars(env, host, hostname);
+            return ret;
+        }
         /* report error */
         ThrowUnknownHostExceptionWithGaiError(env, hostname, error);
         JNU_ReleaseStringPlatformChars(env, host, hostname);