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

Rob McKenna rob.mckenna at oracle.com
Fri Sep 13 10:32:37 PDT 2013


Hi folks, updated webrev at:

http://cr.openjdk.java.net/~robm/7180557/webrev.02/

Hopefully all of your concerns have been addressed.

W.r.t. the use of AI_CANONNAME, this doesn't actually make a difference 
in the context of this fix, but is definitely something that should be 
looked at. I'll put it on the todo list.

     -Rob

On 05/09/13 21:33, Dmitry Samersoff wrote:
> 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
>>
>




More information about the net-dev mailing list