tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: getaddrinfo(3) on numerical addresses
EF> Ah yes, of course. Stupid me. Thanks.
So what I've learned (thanks!) from this discussion:
Calling getaddrinfo() with a hint of AF_INET/AF_INET6 means "if you try hard,
can you make this a IPv4/IPv6 address" (e.g., look up 1.2.3.4.numerical.org
or ::1.i-like-colons.org)
If you want "does this look like a IPv4/IPv6 address" instead, call
getaddrinfo() without a hint and examine res->ai_family.
Which makes sense.
Home |
Main Index |
Thread Index |
Old Index