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
Wed Dec 7 20:34:24 PST 2011


Hi Alan,

On 12/07/2011 04:32 PM, Alan Bateman wrote:
> On 07/12/2011 06:58, Charles Lee wrote:
>> 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
>>
> There's something fishy here. As this is a server then one would guess 
> that it would be configured with at least one static IP address and 
> for the hostname to resolve to one of those addresses. From the mails 
> it sounds like the hostname is resolving to a list that includes an 
> APIPA address address, which suggests to me a Windows bug or else 
> configuration that causes the APIPA to be automatically registered. Do 
> you have a reference to the patch that is causing this, it would be 
> nice to read the description. 
I can not find that from a simple google, but we can find that it is a 
different behaviour from different version.
> Also Microsoft tend to add registry settings to revert behavior 
> changes and maybe there is something for this. As I said in one of the 
> earlier mails, the patch is fine and seems completely benign, it's 
> just that this thread lacks the meat to completely explain why it is 
> needed.
>

I understand.

> -Alan.
>


-- 
Yours Charles




More information about the net-dev mailing list