Mike Hearn (mike_at_theoretic.com) wrote:
On Thu, 2003-10-30 at 18:59, Rob wrote:
bug 1541 is still *not* fixed correctly. See when passing in NULL in windows to gethostbyname, it is guarenteed to return a list of local IP addresses mapped on the box. However, with WINE, passing NULL causes gethostname to be passed into gethostbyname and does *not* always return back the list of local IP addresses on the box. This may work on some boxes, and not others, depending on how the machine is configured and if the DNS lookup on the host name resolves to the local IP addresses.
Ah OK, sorry about that, I reopened the bug. Would getifaddrs() do the trick here? I've not done much work in our winsock code so I can't really help here.
whereas if (!name) should use SIOCGIFCONF - SIOCGIFADDR or something...
Could you write a patch perhaps, as you seen to know what needs to be done.
getifaddrs() is indeed the right beast, though who knows, maybe you'll have to filter out 127.0.0.1. Hitch is, Linux doesn't provide it. Here's an implementation I've used with good results that tries to be portable (I've only tested it on linux, but it claims to handle Solaris):
http://kegel.com/dkftpbench/dkftpbench-0.45/getifaddrs.h http://kegel.com/dkftpbench/dkftpbench-0.45/getifaddrs.c
Wish I had time to code a patch for you, too, but at least this might help. - Dan
On Fri, 2003-10-31 at 00:51, Dan Kegel wrote:
getifaddrs() is indeed the right beast, though who knows, maybe you'll have to filter out 127.0.0.1. Hitch is, Linux doesn't provide it.
I think it does as of the latest glibc, at least it's marked as "done" on their TODO list.
thanks -mike
On October 31, 2003 05:32 am, Mike Hearn wrote:
I think it does as of the latest glibc, at least it's marked as "done" on their TODO list.
So we can stick Dan's implementation in libs/port, and do a configure check for it...
Mike Hearn wrote:
On Fri, 2003-10-31 at 00:51, Dan Kegel wrote:
getifaddrs() is indeed the right beast, though who knows, maybe you'll have to filter out 127.0.0.1. Hitch is, Linux doesn't provide it.
I think it does as of the latest glibc, at least it's marked as "done" on their TODO list.
Hey, you're right. It's there on Red Hat 8 even.
So you could use that when present, and fall back on the current hack (or my implementation) if the system doesn't provide it. - Dan