InetAddress.getLocalHost() returns APIPA/link-local address in a Windows 2008 SP2 or later version Windows OS with multiple-NICs.

Charles Lee littlee at linux.vnet.ibm.com
Tue Dec 6 22:58:29 PST 2011


Hi Chris,

Sorry I can not give a *detailed* description :-P Have you successfully 
get an APIPA address? [1] is the link which describe they have get such 
addresses :-D
The behaviour difference was introduced by the some latest patches from 
the Microsoft. And I am heard recently that they are going to change 
this behaviour back future O:-)

I am thinking that, since APIPA address is available, we may need to 
filter the return address array in case that the native api 
*accidentally* change its behaviour.

[1] http://lmgtfy.com/?q=getaddrinfo+apipa



On 12/07/2011 01:16 AM, Chris Hegarty wrote:
> Charles,
>
> I still don't get this issue. getLocalHost first retrieves the local 
> host name of the system, then does a lookup in the configured name 
> service for this name.
>
> Is it possible for you to give detailed description of your machine 
> setup/configuration and how you are encountering this issue? What is 
> the actual local system name? Is this name resolvable in the 
> configured name service ( DNS ) ?
>
> Thanks,
> -Chris.
>
> On 12/ 2/11 07:45 AM, Charles Lee wrote:
>> On 12/01/2011 06:46 PM, Chris Hegarty wrote:
>>>
>>> On 01/12/2011 10:21, Alan Bateman wrote:
>>>> On 01/12/2011 01:13, Charles Lee wrote:
>>>>>
>>>>> Yes. In the customer scenario, the return value is 169.254.*.*/16
>>>>> address.
>>>> Sorry for all the questions but I'm still scratching my head as to how
>>>> the lookup of the current host's name ends up with a list that 
>>>> includes
>>>> these addresses. Is it definitely a behavior change in 2008 R2 or 
>>>> is it
>>>> possible that the customer has configured the hosts file this way?
>>>
>>> Yes, it would be nice to get the answer to this to understand if this
>>> is a change in behavior in the most recent Windows versions, or if it
>>> is a configuration issue.
>>>
>>> I'll run some tests too, to see if I can reproduce the issue.
>>>
>>> -Chris.
>>>
>>>>
>>>> -Alan.
>>>
>>
>> Hi Chris,
>>
>> The secondary NIC is a usb port, which is related to the rndis. The
>> secondary result seems to appear at the first order in the return array.
>>
>


-- 
Yours Charles




More information about the net-dev mailing list