diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/socketmodule.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index e9ad333..f700e9c 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -622,6 +622,12 @@ setipaddr(char* name, struct sockaddr * addr_ret, int af) memset(&hints, 0, sizeof(hints)); hints.ai_family = af; error = getaddrinfo(name, NULL, &hints, &res); + if (error = EAI_NONAME && af == AF_UNSPEC) { + /* On OSF/1 V5.1, numeric-to-addr conversion + fails if no address family is given. Assume IPv4 for now.*/ + hints.ai_family = AF_INET; + error = getaddrinfo(name, NULL, &hints, &res); + } if (error) { PyGAI_Err(error); return -1; |