]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: ndisc - fix token support
authorTom Gundersen <teg@jklm.no>
Tue, 17 Nov 2015 12:14:36 +0000 (13:14 +0100)
committerTom Gundersen <teg@jklm.no>
Tue, 17 Nov 2015 12:26:51 +0000 (13:26 +0100)
Fixes CID#1338680. Thanks to Thomas Andersen.

src/network/networkd-ndisc.c

index 37c6ec204931a8ee6718c6f908c1f547d0d8c0f1..a2efac78f15e5a4e1d239f350ffe73768e96ca48 100644 (file)
@@ -75,7 +75,7 @@ static void ndisc_prefix_autonomous_handler(sd_ndisc *nd, const struct in6_addr
         address->family = AF_INET6;
         address->in_addr.in6 = *prefix;
         if (in_addr_is_null(AF_INET6, (const union in_addr_union *) &link->network->ipv6_token) == 0)
-                memcpy(&address->in_addr.in6 + 8, &link->network->ipv6_token + 8, 8);
+                memcpy(((char *)&address->in_addr.in6) + 8, ((char *)&link->network->ipv6_token) + 8, 8);
         else {
                 /* see RFC4291 section 2.5.1 */
                 address->in_addr.in6.__in6_u.__u6_addr8[8]  = link->mac.ether_addr_octet[0];