Artem Smotrakov | 26 Jun 19:22 2015
Picon

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

Hello,

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.

Bug: https://bugs.openjdk.java.net/browse/JDK-8129444
Webrev: http://cr.openjdk.java.net/~asmotrak/socks4/webrev.01/

[1] http://docs.oracle.com/javase/8/docs/api/java/net/Socket.html#Socket-java.net.Proxy-
[2] http://docs.oracle.com/javase/8/docs/api/java/net/doc-files/net-properties.html

Artem
Mark Sheppard | 24 Jun 17:34 2015
Picon

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

Hi
    Please oblige and review the change below
which addresses the issue
https://bugs.openjdk.java.net/browse/JDK-8129507

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.

regards
Mark

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

diff -r 9a66ca9b7e36 test/sun/net/www/protocol/http/B6369510.java
--- a/test/sun/net/www/protocol/http/B6369510.java      Tue Jun 23 
14:20:59 2015 -0700
+++ b/test/sun/net/www/protocol/http/B6369510.java      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() + 
"/test/");
-            HttpURLConnection uc = (HttpURLConnection)url.openConnection();
+            HttpURLConnection uc = 
(HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
              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);
              uc.setDoOutput(true);
              uc.setRequestMethod("POST");
              OutputStream os = uc.getOutputStream();

Pavel Rappo | 24 Jun 13:08 2015
Picon

[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?

http://cr.openjdk.java.net/~prappo/8064925/webrev.01/

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

-------------------------------------------------------------------------------
So what has happened in this change?

1. java.net.URLConnection.getContentHandler method now looks for
ContentHandlerFactories also via ServiceLoader mechanism.

2. Existing image & audio handlers in java.desktop has been moved from
'sun.net.www.content' 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@...

-Pavel

Brian Burkhalter | 22 Jun 23:56 2015
Picon

[9] RFR of 8129510: java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java 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 https://bugs.openjdk.java.net/browse/JDK-8042902 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."

Thanks,

Brian

— diff —

--- a/test/java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java
+++ b/test/java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java
<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.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * 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("os.name").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
Picon

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

Please review at your convenience.

Issue:	https://bugs.openjdk.java.net/browse/JDK-8129499
Patch:	http://cr.openjdk.java.net/~bpb/8129499/webrev.00/

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 https://bugs.openjdk.java.net/browse/JDK-8077668.

Thanks,

Brian
Seán Coffey | 12 Jun 11:05 2015
Picon

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

Michael,

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.java test 
instead. Only real way to test this in any case is via network snoops 
and they look good.

bug report : https://bugs.openjdk.java.net/browse/JDK-8072384
jdk 8u webrev : 
http://cr.openjdk.java.net/~coffeys/webrev.8072384.8u/webrev/

--

-- 
Regards,
Sean.

Rob McKenna | 3 Jun 15:25 2015
Picon

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 
failure.

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.

http://cr.openjdk.java.net/~robm/8080819/webrev.01/

	-Rob

Bobby Bissett | 1 Jun 22:14 2015
Picon

"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-2.5.5.3.el6_6-x86_64 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 IPv6Test.java 
import java.net.InetAddress;
import java.net.Socket;

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) {
            e.printStackTrace();
        }
    }
}
[root <at> TWO test]}> 
[root <at> TWO test]}> javac IPv6Test.java && java IPv6Test
Opening socket for: /fe80:0:0:0:20c:29ff:fe98:9210
java.net.SocketException: Permission denied
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:241)
at IPv6Test.main(IPv6Test.java:10)
[root <at> TWO test]}> 
[root <at> TWO test]}> java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (rhel-2.5.5.3.el6_6-x86_64 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.

Thanks,
Bobby

Mark Sheppard | 26 May 21:34 2015
Picon

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

Hi
    please oblige and review the following change
http://cr.openjdk.java.net/~msheppar/8077377/webrev/

to address the issue
https://bugs.openjdk.java.net/browse/JDK-8077377

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.

regards
Mark

Mark Sheppard | 26 May 21:21 2015
Picon

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

Hi
   please oblige and review the following change
http://cr.openjdk.java.net/~msheppar/8041677/webrev/

which addresses the issue
https://bugs.openjdk.java.net/browse/JDK-8041677

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

regards
Mark

Brian Toal | 22 May 08:56 2015
Picon

[PATCH] fix Inet4AddressImpl.lookupAllHostAddr returning unroutable addresses

The fix for https://bugs.openjdk.java.net/browse/JDK-7180557 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
    options=3<RXCSUM,TXCSUM>
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
    inet 127.0.0.1 netmask 0xff000000 
    inet6 ::1 prefixlen 128 
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 28:cf:e9:1a:eb:6b 
    inet6 fe80::2acf:e9ff:fe1a:eb6b%en0 prefixlen 64 scopeid 0x4 
    inet 192.168.0.106 netmask 0xffffff00 broadcast 192.168.0.255
    media: autoselect
    status: active
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
    ether 0a:cf:e9:1a:eb:6b 
    media: autoselect
    status: inactive
utun0: flags=80d1<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1320
    inet 10.3.23.199 --> 10.3.23.199 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 10.3.23.199 and all routes go through that interface. The 192.168.0.106 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;
-    }
-#endif
-
     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;
+        }
+#endif
         /* report error */
         ThrowUnknownHostExceptionWithGaiError(env, hostname, error);
         JNU_ReleaseStringPlatformChars(env, host, hostname);

Gmane