Gabor Gombas <firstname.lastname@example.org> writes:
> On Fri, Oct 07, 2005 at 11:18:57AM -0700, Russ Allbery wrote:
>> * Obtain the system host name with gethostname().
>> * Look up an IP address for that host with gethostbyname().
> The bug is here. This is completely wrong but sadly very common
> practice. It is common because it is portable and works with some simple
> configurations (namely, single-homed machines with static IP address).
Well, I don't really agree with the statement that it's completely wrong,
but I do understand what you're saying about the semantic mismatch at work
>> * Look up the names associated with that address with gethostbyaddr().
>> * Walk the alias list of the result and find the first name containing
>> a period.
> The proper fix would be to enumerate all IP addresses of all network
> interfaces and select one that has an appropriate name. Unfortunately
> this is non-trivial and highly OS-dependent, although the libdumbnet1
> package provides a platform-independent API for this (among other
You've pretty much covered in that paragraph the reasons why INN can't
take that approach. :) I know how hard this is from watching MIT
Kerberos try to solve this problem and don't want to touch this
portability nightmare with a ten-foot pole.
Russ Allbery (email@example.com) <http://www.eyrie.org/~eagle/>