RFR: 7180557 - InetAddress.getLocalHost throws UnknownHostException on java7u5 on OSX

Rob McKenna rob.mckenna at oracle.com
Tue Sep 3 08:18:46 PDT 2013


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/net-dev/attachments/20130903/5f9ef208/attachment.html 


More information about the net-dev mailing list