Skip to content

Commit

Permalink
network: drop casting in memcpy()ing IPv6 address
Browse files Browse the repository at this point in the history
Follow-up for #16067.
  • Loading branch information
yuwata authored and poettering committed Jun 18, 2020
1 parent 2a71d57 commit 845d784
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/network/networkd-ndisc.c
Expand Up @@ -77,7 +77,7 @@ static int make_stableprivate_address(Link *link, const struct in6_addr *prefix,
rid = htole64(siphash24_finalize(&state));

memcpy(addr->s6_addr, prefix->s6_addr, l);
memcpy((uint8_t *) &addr->s6_addr + l, &rid, 16 - l);
memcpy(addr->s6_addr + l, &rid, 16 - l);

return 0;
}
Expand Down Expand Up @@ -299,7 +299,7 @@ static int ndisc_router_generate_addresses(Link *link, unsigned prefixlen, uint3
}
}
} else if (j->address_generation_type == IPV6_TOKEN_ADDRESS_GENERATION_STATIC) {
memcpy(((uint8_t *)&new_address->in_addr.in6) + 8, ((uint8_t *) &j->prefix) + 8, 8);
memcpy(new_address->in_addr.in6.s6_addr + 8, j->prefix.s6_addr + 8, 8);
have_address = true;
}

Expand Down

0 comments on commit 845d784

Please sign in to comment.