RFR: 7180557 - InetAddress.getLocalHost throws	UnknownHostException on java7u5 on OSX
    Dmitry Samersoff 
    dmitry.samersoff at oracle.com
       
    Thu Sep  5 13:13:22 PDT 2013
    
    
  
Rob,
Instead of iterating interfaces list twice you can maintain two indices,
as you already know exact number of addresses.
put_v4_at(i)
put_v6_at(j+v4count)
Also you can take a look at
solaris/native/java/net/NetworkInterface.c
and possibly re-use some logic from there.
-Dmitry
On 2013-09-03 19:18, Rob McKenna wrote:
> Hi folks,
> 
> Mac seems to have trouble looking up local hostnames using getaddrinfo
> unless a domain is set. The solution is to add a check with getifaddrs .
> 
> This fix replaces a usage of _ALLBSD_SOURCE with MACOSX. I haven't seen
> a canonical answer on whether this is the way to go so I figured trial
> by fire might get the discussion going.
> 
> http://cr.openjdk.java.net/~robm/7180557/webrev.01/
> 
>     -Rob
> 
-- 
Dmitry Samersoff
Oracle Java development team, Saint Petersburg, Russia
* I would love to change the world, but they won't give me the sources.
    
    
More information about the net-dev
mailing list