socket.getaddrinfo: flags |= AI_ADDRCONFIG

"Martin v. Löwis" martin at
Wed Nov 5 21:22:46 CET 2008

> 1) mimic glibc default behavior, i.e. if flags is unspecified or
>    None, treat it as the default value of AI_V4MAPPED |

Unfortunately, that contradicts with RFC 3493, which says

#   If hints is a null pointer, the behavior
#   shall be as if it referred to a structure containing the value zero
#   for the ai_flags, ai_socktype and ai_protocol fields, and AF_UNSPEC
#   for the ai_family field.

Of course, we might chose to ignore that.

> Alternatively:
> 2) add these flags to callers of socket.getaddrinfo in various
>    standard libs, e.g. httplib.

There is apparently a problem with this one, also: implementations
might define AI_ADDRCONFIG, but not implement it, but instead return
EAI_BADFLAGS. Not sure whether this is a real problem, though.


More information about the Python-list mailing list