]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
No need to cast to IPv6
authorAlan T. DeKok <aland@freeradius.org>
Tue, 22 Nov 2011 13:33:29 +0000 (14:33 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 22 Nov 2011 13:36:38 +0000 (14:36 +0100)
because we can reference the struct element directly.

src/lib/print.c

index 2d53ad9f8a8595ae03848abc3293ef18c5bc3d13..619889a9587450d2b34ed2707ab81d29df8ffacb 100644 (file)
@@ -312,7 +312,7 @@ int vp_prints_value(char * out, size_t outlen, const VALUE_PAIR *vp, int delimit
 
                case PW_TYPE_IPV6ADDR:
                        a = inet_ntop(AF_INET6,
-                                     (const struct in6_addr *) vp->vp_strvalue,
+                                     &vp->vp_ipv6addr,
                                      buf, sizeof(buf));
                        break;
 
@@ -323,7 +323,7 @@ int vp_prints_value(char * out, size_t outlen, const VALUE_PAIR *vp, int delimit
                        /*
                         *      Alignment issues.
                         */
-                       memcpy(&addr, vp->vp_strvalue + 2, sizeof(addr));
+                       memcpy(&addr, &(vp->vp_ipv6prefix[2]), sizeof(addr));
 
                        a = inet_ntop(AF_INET6, &addr, buf, sizeof(buf));
                        if (a) {