|
Lines 71-76
Link Here
|
| 71 |
struct in_addr in; |
71 |
struct in_addr in; |
| 72 |
int i; |
72 |
int i; |
| 73 |
long int port; |
73 |
long int port; |
|
|
74 |
u_long addr; |
| 74 |
|
75 |
|
| 75 |
port = 0; |
76 |
port = 0; |
| 76 |
if (servname != NULL) { |
77 |
if (servname != NULL) { |
|
Lines 86-92
Link Here
|
| 86 |
} |
87 |
} |
| 87 |
|
88 |
|
| 88 |
if (hints && hints->ai_flags & AI_PASSIVE) { |
89 |
if (hints && hints->ai_flags & AI_PASSIVE) { |
| 89 |
if (NULL != (*res = malloc_ai(port, htonl(0x00000000)))) |
90 |
addr = htonl(0x00000000) |
|
|
91 |
if (hostname && inet_aton(hostname, &in) != 0) |
| 92 |
addr = in.s_addr; |
| 93 |
if (NULL != (*res = malloc_ai(port, addr))) |
| 90 |
return 0; |
94 |
return 0; |
| 91 |
else |
95 |
else |
| 92 |
return EAI_MEMORY; |
96 |
return EAI_MEMORY; |