gethostbyname(my_name) and IL2-Sturmovik

David Nolden at
Tue Dec 13 06:38:35 CST 2005

@Pavel  Troller
I've checkt the /etc/hosts now. You were right, it says	localhost.localdomain	localhost  	Zwirch

(With Zwirch the Name of this Computer) 

But I can't just statically rewrite it, because I use DHCP. Also this is a 
fresh Ubuntu-Install, so I'm surely not the only 
Wine-User with such an /etc/hosts..

You're right, I've checked the patch and it indeed was ugly! But when I sent 
it I hadn't done the check under Windows, so I didn't know if the patch was 
generally useful, so I mainly ment it as a piece for discussion.(Also I 
didn't notice how ugly it really was ;)

I've cleaned it up a bit, closed the leak, and did a few other small tweaks so 
now the patch itself might be acceptable.

greetings, David

Am Dienstag, 13. Dezember 2005 07:04 schrieb Pavel Troller:
> > 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[0]));
> > ...
> > }
> >
> > The string in str was "" which is my Network IP-Adress.  With
> > wine(under Linux), as far as I've tested it, exactly the same code always
> > generates "".
> >
> > Since Wine tries to simulate Windows as exactly as possible, this is
> > wrong. So, in my opinion this Patch is necessary. :-)
> Hi!
>   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)
>	localhost
> arcus
>   I have already seen broken setups containing things like
>	localhost arcus
>   which is of course wrong.
>                          Regards, Pavel Troller
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gethostbyname_nolden_2.diff
Type: text/x-diff
Size: 4089 bytes
Desc: not available
Url :

More information about the wine-devel mailing list