On Wed, May 25, 2011 at 03:41:17PM +0200, Jan Engelhardt wrote: > > 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. I am not sure it is actually a bug. RFC 3493 does not specify this way or the other. It just seems that most other C libraries changed the behavior from "not accepted" to "accepted" in 2009 such that these days the consensus seems to be this way. Best regards, Lutz -- Dr.-Ing. Lutz Jänicke CTO Innominate Security Technologies AG /protecting industrial networks/ tel: +49.30.921028-200 fax: +49.30.921028-020 Rudower Chaussee 13 D-12489 Berlin, Germany www.innominate.com Register Court: AG Charlottenburg, HR B 81603 Management Board: Dirk Seewald Chairman of the Supervisory Board: Volker Bibelhausen -- 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