diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2001-07-21 18:48:56 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2001-07-21 18:48:56 (GMT) |
commit | c7cdc637553d35773e52746fb8a5abac55b06020 (patch) | |
tree | 7679c91fb2e5b00b354a81b22611a91ae6902c30 /Modules | |
parent | 2d8d4276c67d39af113c1a169c2661d7f0f86285 (diff) | |
download | cpython-c7cdc637553d35773e52746fb8a5abac55b06020.zip cpython-c7cdc637553d35773e52746fb8a5abac55b06020.tar.gz cpython-c7cdc637553d35773e52746fb8a5abac55b06020.tar.bz2 |
Set ai_addrlen even if there is no sa_len.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/getaddrinfo.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/getaddrinfo.c b/Modules/getaddrinfo.c index f74b5d6..9bc9917 100644 --- a/Modules/getaddrinfo.c +++ b/Modules/getaddrinfo.c @@ -188,6 +188,7 @@ if (pai->ai_flags & AI_CANONNAME) {\ memcpy(ai, pai, sizeof(struct addrinfo));\ (ai)->ai_addr = (struct sockaddr *)((ai) + 1);\ memset((ai)->ai_addr, 0, (gai_afd)->a_socklen);\ + (ai)->ai_addrlen = (gai_afd)->a_socklen;\ (ai)->ai_addr->sa_family = (ai)->ai_family = (gai_afd)->a_af;\ ((struct sockinet *)(ai)->ai_addr)->si_port = port;\ p = (char *)((ai)->ai_addr);\ |