diff options
-rw-r--r-- | util.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -88,6 +88,8 @@ char *addr2string(struct sockaddr *addr, socklen_t len) { addr = (struct sockaddr *)&sa4; } } + len = addr->sa_family == AF_INET ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6); + if (getnameinfo(addr, len, addr_buf[i], sizeof(addr_buf[i]), NULL, 0, NI_NUMERICHOST)) { debug(DBG_WARN, "getnameinfo failed"); |