continue;
addr.s6_addr32[3] = htonl(c->assigned);
- }
- else {
+ } else {
if (!valid_prefix_length(c, addrs[i].prefix))
continue;
addr.s6_addr32[1] |= htonl(c->assigned);
+ addr.s6_addr32[2] = addr.s6_addr32[3] = 0;
}
inet_ntop(AF_INET6, &addr, ipbuf, sizeof(ipbuf) - 1);
for (size_t i = 0; i < addrlen; ++i) {
struct in6_addr prefix = addrs[i].addr;
prefix.s6_addr32[1] |= htonl(a->assigned);
+ prefix.s6_addr32[2] = prefix.s6_addr32[3] = 0;
odhcpd_setup_route(&prefix, (a->managed_size) ? addrs[i].prefix : a->length,
iface, &a->peer.sin6_addr, 1024, add);
}
.addr = addrs[i].addr
};
p.addr.s6_addr32[1] |= htonl(a->assigned);
+ p.addr.s6_addr32[2] = p.addr.s6_addr32[3] = 0;
size_t entrlen = sizeof(p) - 4;
struct in6_addr addr = addrs[i].addr;
if (ia->type == htons(DHCPV6_OPT_IA_PD)) {
addr.s6_addr32[1] |= htonl(a->assigned);
+ addr.s6_addr32[2] = addr.s6_addr32[3] = 0;
if (!memcmp(&p->addr, &addr, sizeof(addr)) &&
p->prefix == ((a->managed) ? addrs[i].prefix : a->length))
continue;
addr.s6_addr32[1] |= htonl(a->assigned);
+ addr.s6_addr32[2] = addr.s6_addr32[3] = 0;
}
inet_ntop(AF_INET6, &addr, addrbuf, sizeof(addrbuf));
qsort(addr, len, sizeof(*addr), prefixcmp);
for (int i = 0; i < len; ++i) {
- addr[i].addr.s6_addr32[3] = 0;
-
if (addr[i].preferred < UINT32_MAX - now)
addr[i].preferred += now;
addr = iface->ia_addr[i].addr;
if (lease->length == 128)
addr.s6_addr32[3] = htonl(lease->assigned);
- else
+ else {
addr.s6_addr32[1] |= htonl(lease->assigned);
+ addr.s6_addr32[2] = addr.s6_addr32[3] = 0;
+ }
char *c = blobmsg_alloc_string_buffer(&b, NULL, INET6_ADDRSTRLEN);
inet_ntop(AF_INET6, &addr, c, INET6_ADDRSTRLEN);