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

Dmitry Samersoff dmitry.samersoff at oracle.com
Thu Sep 5 13:33:35 PDT 2013


Rob,

Did you try to remove

hints.ai_flags = AI_CANONNAME

this flag asks getaddreinfo to return FQDN, but the function behavior is
not clearly defined for the case where FQDN is not available.

-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