|
Lines 61-69
Link Here
|
| 61 |
from4->sin_family = AF_INET; |
61 |
from4->sin_family = AF_INET; |
| 62 |
memcpy(&from4->sin_addr, &addr, sizeof(addr)); |
62 |
memcpy(&from4->sin_addr, &addr, sizeof(addr)); |
| 63 |
from4->sin_port = port; |
63 |
from4->sin_port = port; |
|
|
64 |
|
| 65 |
fromlen = sizeof(struct sockaddr_in); |
| 64 |
} |
66 |
} |
| 65 |
} |
67 |
} |
| 66 |
#endif |
68 |
#endif |
|
|
69 |
#ifdef __linux__ |
| 70 |
if (from.ss_family == AF_INET6) |
| 71 |
fromlen = sizeof(struct sockaddr_in6); |
| 72 |
#endif |
| 67 |
|
73 |
|
| 68 |
if (getnameinfo((struct sockaddr *)&from, fromlen, ntop, sizeof(ntop), |
74 |
if (getnameinfo((struct sockaddr *)&from, fromlen, ntop, sizeof(ntop), |
| 69 |
NULL, 0, NI_NUMERICHOST) != 0) |
75 |
NULL, 0, NI_NUMERICHOST) != 0) |
|
Lines 225-230
Link Here
|
| 225 |
< 0) |
231 |
< 0) |
| 226 |
return NULL; |
232 |
return NULL; |
| 227 |
} |
233 |
} |
|
|
234 |
|
| 235 |
#ifdef __linux__ |
| 236 |
if (addr.ss_family == AF_INET6) |
| 237 |
addrlen = sizeof(struct sockaddr_in6); |
| 238 |
#endif |
| 239 |
|
| 228 |
/* Get the address in ascii. */ |
240 |
/* Get the address in ascii. */ |
| 229 |
if (getnameinfo((struct sockaddr *)&addr, addrlen, ntop, sizeof(ntop), |
241 |
if (getnameinfo((struct sockaddr *)&addr, addrlen, ntop, sizeof(ntop), |
| 230 |
NULL, 0, flags) != 0) { |
242 |
NULL, 0, flags) != 0) { |
|
Lines 319-324
Link Here
|
| 319 |
fatal_cleanup(); |
331 |
fatal_cleanup(); |
| 320 |
} |
332 |
} |
| 321 |
} |
333 |
} |
|
|
334 |
|
| 335 |
#ifdef __linux__ |
| 336 |
if (from.ss_family == AF_INET6) |
| 337 |
fromlen = sizeof(struct sockaddr_in6); |
| 338 |
#endif |
| 339 |
|
| 322 |
/* Return port number. */ |
340 |
/* Return port number. */ |
| 323 |
if (getnameinfo((struct sockaddr *)&from, fromlen, NULL, 0, |
341 |
if (getnameinfo((struct sockaddr *)&from, fromlen, NULL, 0, |
| 324 |
strport, sizeof(strport), NI_NUMERICSERV) != 0) |
342 |
strport, sizeof(strport), NI_NUMERICSERV) != 0) |