[Wine] Re: gethostbyname(my_name) and IL2-Sturmovik
patrol at sinus.cz
Tue Dec 13 00:04:28 CST 2005
> Ok, I've just checked doing the same thing under windows.
> The test(ripdaveno is the name of the Computer I tested on):
> hostent* h = gethostbyname("ripdaveno");
> char* str = inet_ntoa(*((in_addr*)h->h_addr_list));
> The string in str was "192.168.2.75" which is my Network IP-Adress. With
> wine(under Linux), as far as I've tested it, exactly the same code always
> generates "127.0.0.1".
> Since Wine tries to simulate Windows as exactly as possible, this is wrong.
> So, in my opinion this Patch is necessary. :-)
It's strange but there is no patch in this mail I can look at...
However, even more strange is that wine returns localhost address to you...
Why ? I just tested Your testing code (just slightly modified to get it to
compile) on both plain linux as well as in wine and in both cases it returns my
real public IP. Isn't your Linux networking setup (/etc/hosts table) a bit
wrong ? My one contains (arcus is my machine name)
22.214.171.124 arcus.sinus.cz arcus
I have already seen broken setups containing things like
127.0.0.1 localhost arcus
which is of course wrong.
Regards, Pavel Troller
More information about the wine-users