Hello list,
I want to continue a discussion about a problem already reported by David Nolden in December 2005. It is about what gethostbyname should return if given the machines name and does not only affect IL-2 Sturmovik. Placing a quick cite of him here:
[...] The Problem: gethostbyname(own_name) always returns 127.0.0.1. [...] The socket is then bound to the ip-adress 127.0.0.1, and to it's corresponding loopback-interface, so it's unusable. Any connection-request times out. [...]
All the discussion back then happened (in wine-devel) between the 12.12.2005 and 14.12.2005. Subject: "gethostbyname(my_name) and IL2-Sturmovik" And a Patch: wine-patches: 17.01.2006 02:00:21 Subject: gethostbyname-patch
Check also Bug #7929 (duplicated by #8075).
My opinion is simple: To me it's logical that you get 127.0.0.1 when pinging your local hostname, but if windows does give the IP of your NIC then wine should do as well - as we want to reach compatibility.
If, on the other hand, you say it's simply bad programming done by the app-developer if he tries to fetch the IP of the NIC that way, I'd say let's still comply to it, because its more likely than having a programmer expecting to get 127.0.0.1 when asking for "localhostname".
Any comments welcome!
On Fri, Apr 20, 2007 at 12:09:55PM +0200, Briareos wrote:
My opinion is simple: To me it's logical that you get 127.0.0.1 when pinging your local hostname, but if windows does give the IP of your NIC then wine should do as well - as we want to reach compatibility.
If, on the other hand, you say it's simply bad programming done by the app-developer if he tries to fetch the IP of the NIC that way, I'd say let's still comply to it, because its more likely than having a programmer expecting to get 127.0.0.1 when asking for "localhostname".
to my very (VERY!) limited knowledge of windows somebody told me in a project (we aimed to write a proxy to make connections to a game "secure") the principle of "binding to an address" is unknown to windows - at least for the non-NT based branch. if this is true we should always bind sockets to 0/0 regardless what the app tells us. i am sure some windows/network gurus around can tell more.
On Friday 20 April 2007 12:09, Briareos wrote:
My opinion is simple: To me it's logical that you get 127.0.0.1 when pinging your local hostname, but if windows does give the IP of your NIC then wine should do as well - as we want to reach compatibility.
If, on the other hand, you say it's simply bad programming done by the app-developer if he tries to fetch the IP of the NIC that way, I'd say let's still comply to it, because its more likely than having a programmer expecting to get 127.0.0.1 when asking for "localhostname".
There is no "bad programming" in this context. Either it works this way on Windows and we'll have to cope with it or not. I'll look at those traces again and will send a conformance test to check this.
Cheers, Kai