Calling getaddrinfo() with invalid IPv4 literal

Florian Weimer
Wed May 13 03:33:28 GMT 2020

* Scott Talbert via Libc-help:

> What is the expected behavior when calling getaddrinfo() with an invalid 
> IPv4 literal?  By invalid, I mean a dotted quad where one or more of the 
> parts is outside 0-255.
> For example, getaddrinfo("", ...).
> Currently, it seems this succeeds, but returns some sort of (rolled over?) 
> address.  Previously at some point, it seems this used to return an error.

You need to provide more information about your system, like glibc
version, applied patches, and what's on the “hosts” line in

I believe stock glibc has failed getaddrinfo queries for the name you
indicate for a long, long time.

More information about the Libc-help mailing list