RFC compliant address selection vs. home made getaddrinfo
Bernd Eckenfels
bernd-2013 at eckenfels.net
Thu Jun 13 14:11:45 PDT 2013
Hello Michael,
Am 13.06.2013, 12:24 Uhr, schrieb Michael McMahon
<michael.x.mcmahon at oracle.com>:
> This does cause some confusion. The method getCanonicalHostName() was
> never intended
> to return the CNAME from DNS. Rather it was intended to return the name
> that results
> from a reverse lookup of the IP address (ie the PTR).
Well, the name implies otherwise and the documentation is vague, so I
guess nobody uses it anyway. The label "canonical" in that context is from
the POSIX specification of the getaddinfo, and it does not mean reverse
lookups:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html
# "If the AI_CANONNAME flag is specified and the nodename argument is not
null,
# the function shall attempt to determine the canonical name corresponding
to
# nodename (for example, if nodename is an alias or shorthand notation for
a complete name).
# Note:
# Since different implementations use different conceptual models, the
terms ``canonical name''
# and ``alias'' cannot be precisely defined for the general case. However,
Domain Name System
# implementations are expected to interpret them as they are used in RFC
1034.
However I am fine with not touching that method.
But I think the AI_CANONNAME can and should be removed in most all of the
places in that source. This will reduce syscalls/roundtrips and should not
change any semantic. Anybody know if there was a reason for it? Should I
file an Bug for that?
Bernd
--
http://bernd.eckenfels.net
More information about the net-dev
mailing list