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



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

No it wouldn't. The problem occurs for me precisely with the default
setting of use_local_host = LINK_NET_ID_IS_IPADDR. The problem is that
other code in linc2 later calls gethostbyaddr() to look up a name for
that address net_getid() returned, and that name is then passed
around, until yet other code then calls gethostbyname() to look up the
address for the name, and that address is different that the one
get_netid() returned.

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

Sure, and also drop the calls to gethostbyaddr() in
link_protocol_get_sockinfo_ipv4/6() and instead have them simply store
the ASCII representation of the sockaddr in hostname. For backward
compatibility, linc2 should still *accept* also hostnames, but it
should *produce* only numerical IP addresses.

--tml



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