I recently upgraded to glibc-2.1.1pre2 from glibc-2.1.1pre1, and found that
doing a gethostbyname on IP addresses now fails. For instance, the following
code returns NULL on a glibc-2.1.1pre2 machine, and the same binary works fine
on another non-glibc-2.1.1pre2 machine:
if ((ht = gethostbyname("127.0.0.1")) == NULL) {
printf("Error: %d ", h_errno);
else
printf("Fine and dandy\n");
In this case, h_errno is set to HOST_NOT_FOUND.
Compiling the program statically on a good machine results in good behavior on
the glibc-2.1.1pre2 machine.
Compiling statically on the glibc-2.1.1pre2 machine results in broken behavior
on the non-glibc-2.1.1pre2 machine.
If there's any other information you need, just ask.
-Dave