On Sun, 14 Nov 2010 09:48:40 -0500, Johannes Hofmann <Johannes.Hofmann@gmx.de> wrote:
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.
...not to mention Microsoft's runtime library (inet_ntop wasn't added until Windows Vista, IIRC). So pretty much a win-win, then?
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?
I'll trust your judgment on this one. I was more or less learning the sockets interface as I went along, so I just went with the first thing that compiled and ran. I'm sure that's not the worst piece of code in there...
The "undef D_DNS_THREADED" would be more appropriate in the WIN32 specific section of configure.
Sounds good to me. That bit was coded before the autoconf stuff, so that's my excuse for not doing it sooner. :-)
Plus I'd skip the more "correct" thing in the comment, but that's just my personal feeling.
Fine with me. That wasn't really intended to stay, anyway; I just figured there should be some justification for the change. I will try to fix that patch as soon as possible. In the meantime I'll await further feedback Cheers, ~Benjamin