udhcpc6: fix aliasing warning
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 11 Jun 2019 16:18:48 +0000 (18:18 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 11 Jun 2019 16:18:48 +0000 (18:18 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/udhcp/d6_dhcpc.c

index 422b8888247e25922d33fc5700c42900e33ba3c2..4eb7ae1c19690a5bd761666bf82828334c17ce35 100644 (file)
@@ -643,7 +643,7 @@ static NOINLINE int send_d6_discover(uint32_t xid, struct in6_addr *requested_ip
                client6_data.ia_na = xzalloc(len);
                client6_data.ia_na->code = D6_OPT_IA_NA;
                client6_data.ia_na->len = len - 4;
-               *(uint32_t*)client6_data.ia_na->data = rand(); /* IAID */
+               *(bb__aliased_uint32_t*)client6_data.ia_na->data = rand(); /* IAID */
                if (requested_ipv6) {
                        struct d6_option *iaaddr = (void*)(client6_data.ia_na->data + 4+4+4);
                        iaaddr->code = D6_OPT_IAADDR;
@@ -661,7 +661,7 @@ static NOINLINE int send_d6_discover(uint32_t xid, struct in6_addr *requested_ip
                client6_data.ia_pd = xzalloc(len);
                client6_data.ia_pd->code = D6_OPT_IA_PD;
                client6_data.ia_pd->len = len - 4;
-               *(uint32_t*)client6_data.ia_pd->data = rand(); /* IAID */
+               *(bb__aliased_uint32_t*)client6_data.ia_pd->data = rand(); /* IAID */
                opt_ptr = mempcpy(opt_ptr, client6_data.ia_pd, len);
        }