diff options
author | Karl Ramm <kcr@mit.edu> | 2009-03-20 06:39:23 +0000 |
---|---|---|
committer | Karl Ramm <kcr@mit.edu> | 2009-03-20 06:39:23 +0000 |
commit | 4565e1baf3c5f432538274e0b706659fd63620e8 (patch) | |
tree | 312e3a49d0e0121edbd7e96f8c7f2625ce98763f /zwgc | |
parent | 92a3c815358d8fe856ed6049740e116c4fbebff3 (diff) |
ares_getnameinfo makes the decision on the address family BY THE LENGTH OF THE SOCKADDR_IN ARGUMENT
Diffstat (limited to 'zwgc')
-rw-r--r-- | zwgc/main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/zwgc/main.c b/zwgc/main.c index e66e209..1725c13 100644 --- a/zwgc/main.c +++ b/zwgc/main.c @@ -407,7 +407,12 @@ notice_handler(ZNotice_t *notice) #endif #ifdef HAVE_ARES - ares_getnameinfo(achannel, (const struct sockaddr *)&(notice->z_sender_sockaddr), + ares_getnameinfo(achannel, + (const struct sockaddr *)&(notice->z_sender_sockaddr), + notice->z_sender_sockaddr.sa.sa_family == AF_INET ? + sizeof(struct sockaddr_in) : + notice->z_sender_sockaddr.sa.sa_family == AF_INET6 ? + sizeof(struct sockaddr_in6) : sizeof(notice->z_sender_sockaddr), ARES_NI_LOOKUPHOST, notice_callback, notice); |