["Alexander V. Lukyanov" <lav@long.yar.ru>] libc/1096: gethostbyname fails to handle addresses like 10.1234

Andreas Jaeger aj@arthur.rhein-neckar.de
Sun Apr 25 13:58:00 GMT 1999


I've verified the appended bug report with the current glibc 2.1
version.

The problem seems to be the usage of inet_pton in nss/digits_dots.c.
inet_pton doesn't convert 10.1234 (but inet_aton should do so).

Looking at inet_pton.c from glibc I noticed that inet_pton accepts
only dotted quad:
 * inet_pton4(src, dst)
 *      like inet_aton() but without all the hexadecimal and shorthand.
 * return:
 *      1 if `src' is a valid dotted quad, else 0.

Now the questions are:
- should gethostbyname accept "10.1234" ?
- should inet_pton accept "10.1234" ?

Depending on the answer to these two question, we might have to fix
digits_dots.c or inet_pton.c.

Andreas



More information about the Libc-hacker mailing list