On 08/02/2010 10:12 AM, ajs(a)redhat.com wrote:
inet_pton is provided within gnulib which gives us another
portability option, however, src/xslt_ext.c uses inet_aton when processing a netmask
(roughly line 113). Is it acceptable to possibly replace inet_aton? I think inet_pton(3)
would be a good replacement though there are some caveats in the notes section of its man
page.
What about getaddrinfo? That is also in gnulib, and seems a bit more
complete in what it accepts (although I don't think we really need to
worry about esoteric usages, since there aren't a lot of people using
netcf yet, so there hasn't been a chance for anyone to develop bad
habits ;-)
I looked in libvirt as an example, and it uses both inet_pton() and
getaddrinfo, but getaddrinfo is winning out about 3:1.