From 92bc8d325e77850fc2a841e1817420dfe71c001b Mon Sep 17 00:00:00 2001 From: phk Date: Wed, 3 Sep 2008 13:20:45 +0000 Subject: [PATCH] Cater for even more INET6 API stupidity. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3161 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_vrt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache_vrt.c b/varnish-cache/bin/varnishd/cache_vrt.c index 5fae2659..ddd982d7 100644 --- a/varnish-cache/bin/varnishd/cache_vrt.c +++ b/varnish-cache/bin/varnishd/cache_vrt.c @@ -594,17 +594,21 @@ char * VRT_IP_string(const struct sess *sp, const struct sockaddr *sa) { char *p; + const struct sockaddr_in *si4; + const struct sockaddr_in6 *si6; const void *addr; int len; switch (sa->sa_family) { case AF_INET: len = INET_ADDRSTRLEN; - addr = &((const struct sockaddr_in *)sa)->sin_addr; + si4 = (const void *)sa; + addr = &(si4->sin_addr); break; case AF_INET6: len = INET6_ADDRSTRLEN; - addr = &((const struct sockaddr_in6 *)sa)->sin6_addr; + si6 = (const void *)sa; + addr = &(si6->sin6_addr); break; default: INCOMPL(); -- 2.39.5