Commit a834d6b2 authored by Pekka Pessi's avatar Pekka Pessi

Fixed bug in su_addrinfo.c [FIX].

Setting ai_addrlen even if there is no sa_len.

darcs-hash:20051207132129-65a35-c80dd655e732b30938799bd03ad99f13c99cb8d2.gz
parent 17ea4aa1
...@@ -174,6 +174,7 @@ if (pai->ai_flags & AI_CANONNAME) {\ ...@@ -174,6 +174,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);\
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment