sendmail vs ipv6 broken after upgrade to 9.1

Ben Morrow ben at morrow.me.uk
Wed Jan 9 16:29:05 UTC 2013


Quoth Hajimu UMEMOTO <ume at FreeBSD.org>:
> >>>>> On Wed, 09 Jan 2013 23:01:52 +0900
> >>>>> Hajimu UMEMOTO <ume at FreeBSD.org> said:
> 
> ume> I changed getipnodebyname to obey ip6addrctl in years past.  I read
> ume> RFC 2553 again, and realize that it mentions IPv6 addresses are
> ume> returned 1st.  So, my past change might be bad thing. X-(

Where does it say that? All I can find (but I might be being stupid) is
the bit in the description of AI_ALL where it says 'A query is first
made for AAAA records and if successful, the IPv6 addresses are
returned. Another query is then made for A records and any found are
returned as IPv4-mapped IPv6 addresses.'. I don't believe that is meant
to indicate the AAAA results are returned first in the list, just that
both sets of results are included.

Also, RFC 6724 (which is more recent), says 'we intend that
implementations of APIs such as getaddrinfo() will use the destination
address selection algorithm specified here to sort the list of IPv6 and
IPv4 addresses that they return.'. AFAICS 'APIs such as getaddrinfo()'
is supposed to include getipnodebyname and gethostbyname2, and the whole
list of v4 and v6 addresses is supposed to be sorted by those rules.

However, given that FreeBSD disables the use of v4-mapped addresses on
AF_INET6 sockets by default, it might be sensible to change the rules a
little. An application making an AF_INET6 query is probably going to use
the result with an AF_INET6 socket, so a v4-mapped address is going to
be mostly useless.

> I've just committed to disable it:
> 
> http://svnweb.freebsd.org/base?view=revision&revision=245225

I don't think that's the right answer. Even if the code should be
changed to always return addresses from A records last, the IPv6
addresses from AAAA records should still be sorted according to
ip6addrctl. Otherwise sites with multiple prefixes (say, a ULA prefix
and a global prefix) won't be able to control their use properly.

Ben



More information about the freebsd-stable mailing list