On Apr 2, 2013, at 9:29 AM, Simo Sorce <simo@xxxxxxxxxx> wrote: > On Tue, 2013-04-02 at 08:51 -0700, Chuck Lever wrote: >>> Is this "reinventing the wheel"? ;-) Don't we already have a why of >> determining a FQDN? >>> Maybe not... >> >> Yes, we do. Have a look in support/export/hostname.c for tools and >> helpers for dealing with IP addresses properly. >> > The only function I see that may fit the bill is host_addrinfo() which > calls getaddrinfo() which I avoided because gssapi will alraedy do that. That looks like the right way to do it. It may be reasonable to assume our resolver caches results, so a second call may not be much of a latency hit. But AI_CANONNAME may rely on the target host having a PTR record. > Maybe it is ok to only check by negatives ? > IE check if the string is an ipv4 or an ipv6 address and if not just > pass the string in as is ? IIRC, the pton() function fails if your string does not contain a presentation address. But that allows unqualified domain labels, doesn't it? -- Chuck Lever chuck[dot]lever[at]oracle[dot]com -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html