ws2_32: Update WS_get_local_ips to not return a bogus IP address.

Bruno Jesus 00cpxxx at
Wed Nov 25 01:57:35 CST 2015

On Wed, Nov 25, 2015 at 6:55 AM, Joachim Priesner
<joachim.priesner at> wrote:
> Am Dienstag, 24. November 2015 schrieb Jamie Taylor:
>> Is the resulting list of addresses supposed to contain loopback addresses?
>> (I.e., does it on Windows?  I don't have a Windows machine on which to
>> test.)
> It seems that this is the case -- gethostbyname(gethostname()) returned as the only address in a VMware VM with network adapters removed.

You mean a Windows VMWare, right? XP?

> Currently, Wine does not seem to replicate that behavior. I have been watching this for some time, as I use an application that crashes for this reason -- unless an Ethernet cable is plugged in, gethostbyname(gethostname()) returns NULL on Wine (which the native Linux version of gethostbyname also does, for that matter). I haven't dug into ws2_32 enough to be able to fix this, but if there is to be a Definitive Fix(TM) for this function, this behavior should probably be looked at.

There is still things missing in our current knowledge, for example we
have a Win 2008 test VM with 2 network adapters and it returns the
default route as second IP instead of first in gethostbyname.

More information about the wine-devel mailing list