From 6f875650c9e6cb3c5f149e42698d71b9c98116d3 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Thu, 20 Mar 2014 07:29:17 +0100 Subject: [PATCH] when printing link-local addresses do not include the zone info. --- src/log.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/log.c b/src/log.c index fd3b952f..43c64aab 100644 --- a/src/log.c +++ b/src/log.c @@ -49,6 +49,14 @@ char *human_addr2(const struct sockaddr *sa, socklen_t salen, if (getnameinfo(sa, salen, buf, buflen, NULL, 0, NI_NUMERICHOST) != 0) return NULL; + if (salen == sizeof(struct sockaddr_in6)) { + char *p = strchr(buf, '%'); + /* remove any zone info */ + if (p != NULL) { + *p = 0; + } + } + if (full == 0) goto finish;