On Wednesday 2011-05-25 15:26, Lutz Jaenicke wrote: >On Wed, May 25, 2011 at 02:31:05PM +0200, Jan Engelhardt wrote: >> >> >getaddrinfo() will fail for numeric port numbers if neither >> >the socket type (stream/datagram) nor the protocol is >> >provided. [in uclibc] > >As I wrote in my introduction for the patch (which has not yet made it to the >mailing list), other C libraries behave like uClibc: >* http://gitorious.org/0xdroid/bionic/blobs/9ab75d4cc803e91b7f1b656ffbe2ad32c52a86f9/libc/netbsd/net/getaddrinfo.c > -> look for "ANDROID-SPECIFIC CHANGE TO MATCH GLIBC" :-) >* http://www.freebsd.org/cgi/query-pr.cgi?pr=51827 >* Especially I like > http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/lib/libc/net/getaddrinfo.c?rev=1.72;content-type=text%2Fplain > which in the text says > /* > * check for special cases. (1) numeric servname is disallowed if > * socktype/protocol are left unspecified. (2) servname is disallowed > * for raw and other inet{,6} sockets. > */ > (and I took this as a reference until now) but later in get_portmatch(): > case SOCK_DGRAM: > case SOCK_STREAM: > case ANY: > allownumeric = 1; So in other words, four libraries allow it, and one - Âclibc - has a bug that should be fixed. -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html