Re: [PATCH] New ORB_init option "ORBNetID=<string>"



On Wed, 2005-07-27 at 16:25 +0300, Tor Lillqvist wrote:
> I think this patch broke test-linc on multihomed hosts. I have tested
> only on Win32, but assume the same can happen on Unix. The scenario,
> as I see it, is as follows:
> 
> - get_netid() looks up the interfaces of the machine, and chooses the
> address if the first non-loopback one it finds. 
> 
> - link_server_setup() creates a socket and binds it to this address.
> 
> - link_server_setup() calls link_protocol_get_sockinfo() which calls
> link_protocol_get_sockinfo_ipv4(), which calls gethostbyaddr() on the
> address get_netid() returned. This returns a name for the machine.
> 
> - create_client() then tries to connect to the server using the name
> looked up by link_protocol_get_sockinfo_ipv4(). Eventually
> link_protocol_get_sockaddr_ipv4() is called and it looks up this
> name. This however returns *another* one of the machine's
> addresses. Thus the connection fails.

So the address returned by get_netid() must always be an IP address.
That would ensure that no lookup is done.

> I.e. the problem is that the IP address get_netid() returns is not
> necessarily the one that looking up the address corresponding to the
> machine's name will return.
> 
> The use of hostnames and/or IP addresses in linc2 seems quite mixed up
> and confusing. Couldn't we just stop using hostnames completely in
> ORBit2, and use only IP (v4 or v6) addresses in IORs etc?

I agree. Would the right cure be to change get_netid() to
unconditionally return an IP address and simply remove the ORBNetID
option entirely? 


-- 
  jules




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]