InetAddress.getLocalHost() returns APIPA/link-local address in a Windows 2008 SP2 or later version Windows OS with multiple-NICs.
Alan Bateman
Alan.Bateman at oracle.com
Wed Dec 7 00:32:20 PST 2011
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. 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.
-Alan.
More information about the net-dev
mailing list