]> err.no Git - varnish/commitdiff
Cater for even more INET6 API stupidity.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 3 Sep 2008 13:20:45 +0000 (13:20 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 3 Sep 2008 13:20:45 +0000 (13:20 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3161 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_vrt.c

index 5fae2659a211ea008b4aea8e9eebc94c54dbb632..ddd982d742a68cdbdec478591678bba4e147b15f 100644 (file)
@@ -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();