On 3 Sep 2019, at 16:49, Alan Bateman <alan.bate...@oracle.com> wrote:
> 
> On 03/09/2019 15:59, Rob McKenna wrote:
>> Hi folks,
>> 
>> Assuming the premise of this bug is correct, could I get a review for
>> the following:
>> 
>> https://bugs.openjdk.java.net/browse/JDK-8219640
>> http://cr.openjdk.java.net/~robm/8219640/webrev.01/
>> 
>> Windows rejects a lookup for "127.0.0.1 test" where getaddrinfo on
>> non-Windows platforms resolves to 127.0.0.1. Note: this only happens
>> when the set of characters before the space corresponds to an IP
>> address. Both sets of platforms will reject "somehost name".
> Can you say more about which operating systems / versions where this occurs?

Results from two systems I have locally:

$ uname -a
Darwin dhcp-xxxxx 18.5.0 Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 
2019; root:xnu-4903.251.3~3/RELEASE_X86_64 x86_64

$ ~/binaries/jdk-11.0.1.jdk/Contents/Home/bin/jshell 
|  Welcome to JShell -- Version 11.0.1
|  For an introduction type: /help intro

jshell> java.net.InetAddress.getByName("127.0.0.1 tttt")
|  Exception java.net.UnknownHostException: 127.0.0.1 tttt: nodename nor 
servname provided, or not known
|        at Inet6AddressImpl.lookupAllHostAddr (Native Method)
|        at InetAddress$PlatformNameService.lookupAllHostAddr 
(InetAddress.java:929)
|        at InetAddress.getAddressesFromNameService (InetAddress.java:1515)
|        at InetAddress$NameServiceAddresses.get (InetAddress.java:848)
|        at InetAddress.getAllByName0 (InetAddress.java:1505)
|        at InetAddress.getAllByName (InetAddress.java:1364)
|        at InetAddress.getAllByName (InetAddress.java:1298)
|        at InetAddress.getByName (InetAddress.java:1248)
|        at (#1:1)

---
... 
Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.15.0-54-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage
...
$ uname -a
Linux chegar 4.15.0-54-generic #58~16.04.1-Ubuntu SMP Mon Jun 24 13:21:41 UTC 
2019 x86_64 x86_64 x86_64 GNU/Linux

$ ~/binaries/jdk-11/bin/jshell 
|  Welcome to JShell -- Version 11
|  For an introduction type: /help intro

jshell> java.net.InetAddress.getByName("127.0.0.1 tttt")
$1 ==> 127.0.0.1 tttt/127.0.0.1


-Chris.


Reply via email to