nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] IPv6-ifying nmh

2009-01-12 23:10:15
    Date:        Mon, 12 Jan 2009 10:52:00 -0500
    From:        Ken Hornstein <kenh(_at_)cmf(_dot_)nrl(_dot_)navy(_dot_)mil>
    Message-ID:  
<200901121552(_dot_)n0CFq2bs001604(_at_)hedwig(_dot_)cmf(_dot_)nrl(_dot_)navy(_dot_)mil>

  | I don't know what the issue is here, but I think the key is to try all
  | of the addresses returned by getaddrinfo().

What's probably most important is to not issue bogus error messages.

That is, if getaddrinfo() returns a v6 address, but connecting to
it fails (after which you go on to try a v4 address perhaps, which
also fails) the common practice of reporting the first detected error
is often what causes problems.

Not to the application, if any address works, no error is reported, and
everyone is happy, but to the sanity of the user, who often tends to
see an error message reporting v6 failures when they never expected v6
to work for them - but getaddrinfo() happened to return a v6 address first.

That causes people to waste lots of time debugging the wrong problem
(the real issue in the postulated case isn't why the v6 connect() failed,
but why the later v4 connect() didn't work).

Doing this well is not at all easy, sometimes the best course is to
simply note "unable to connect to domain.name" and 'forget' to mention
the IP address (any IP address of any version) and omit the strerror()
explanation for why the connect failed (because guessing which of the several
errno values that ended up being seen is the one the user needs to know
about is just that - guessing).

kre



_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
http://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>