mirror of https://github.com/python/cpython
Set ai_addrlen even if there is no sa_len.
This commit is contained in:
parent
2d8d4276c6
commit
c7cdc63755
|
@ -188,6 +188,7 @@ if (pai->ai_flags & AI_CANONNAME) {\
|
||||||
memcpy(ai, pai, sizeof(struct addrinfo));\
|
memcpy(ai, pai, sizeof(struct addrinfo));\
|
||||||
(ai)->ai_addr = (struct sockaddr *)((ai) + 1);\
|
(ai)->ai_addr = (struct sockaddr *)((ai) + 1);\
|
||||||
memset((ai)->ai_addr, 0, (gai_afd)->a_socklen);\
|
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;\
|
(ai)->ai_addr->sa_family = (ai)->ai_family = (gai_afd)->a_af;\
|
||||||
((struct sockinet *)(ai)->ai_addr)->si_port = port;\
|
((struct sockinet *)(ai)->ai_addr)->si_port = port;\
|
||||||
p = (char *)((ai)->ai_addr);\
|
p = (char *)((ai)->ai_addr);\
|
||||||
|
|
Loading…
Reference in New Issue