From: des Date: Fri, 11 Aug 2006 14:45:37 +0000 (+0000) Subject: Dirty hack: strip the leading "::ffff:" from v4-to-v6-mapped addresses. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9b1573ec0a46d4dfd863082ed6505c7b6f48bc2;p=varnish Dirty hack: strip the leading "::ffff:" from v4-to-v6-mapped addresses. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@816 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/tcp.c b/varnish-cache/bin/varnishd/tcp.c index 9bf6f7b2..5e489734 100644 --- a/varnish-cache/bin/varnishd/tcp.c +++ b/varnish-cache/bin/varnishd/tcp.c @@ -33,6 +33,12 @@ TCP_name(struct sockaddr *addr, unsigned l, char *abuf, unsigned alen, char *pbu strlcpy(pbuf, "Failed", plen); return; } + /* XXX dirty hack for v4-to-v6 mapped addresses */ + if (strncmp(abuf, "::ffff:", 7) == 0) { + for (i = 0; abuf[i + 7]; ++i) + abuf[i] = abuf[i + 7]; + abuf[i] = '\0'; + } } /*--------------------------------------------------------------------*/