On Fri, Nov 12, 2010 at 11:05:38PM +0100, Joerg Sonnenberger wrote:
On Fri, Nov 12, 2010 at 09:41:53PM +0000, corvid wrote:
I thought I'd at least look into the inet_ntop() -> getnameinfo() bit, and I see that the latter is posix 2001.
It is relatively easy to emulate the ipv4 part of getnameinfo(), but a lot harder to properly support IPv6 without using it.
Do we have an official position on posix 2001?
Regarding the use of getnameinfo(), I'd be pragmatic. It's supported by glibc, all Free-, Net-, and OpenBSD and also Android's libc. So I don't see a problem using it. The memcpy however looks like it would create a stack overflow when used with IPv6 addresses. What about using struct sockaddr_storage and maybe even an additional assert() to make sure it doesn't overrun? The "undef D_DNS_THREADED" would be more appropriate in the WIN32 specific section of configure. Plus I'd skip the more "correct" thing in the comment, but that's just my personal feeling. Cheers, Johannes