From 3b4e6d19b7ce0953efcd6d1c545b031b73e0ab6e Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Mon, 30 Mar 2015 10:53:11 +0200 Subject: [PATCH] dhcpv6: fix default assignment of non-64 Signed-off-by: Steven Barth --- src/dhcpv6-ia.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c index f850b02..7db4cee 100644 --- a/src/dhcpv6-ia.c +++ b/src/dhcpv6-ia.c @@ -264,7 +264,8 @@ void dhcpv6_write_statefile(void) for (size_t i = 0; i < addrlen; ++i) { if (addrs[i].prefix > 96 || c->valid_until <= now || - (iface->managed < RELAYD_MANAGED_NO_AFLAG && i != m)) + (iface->managed < RELAYD_MANAGED_NO_AFLAG && i != m && + addrs[i].prefix == 64)) continue; addr = addrs[i].addr; @@ -764,7 +765,8 @@ static size_t append_reply(uint8_t *buf, size_t buflen, uint16_t status, n.addr.s6_addr32[3] = htonl(a->assigned); size_t entrlen = sizeof(n) - 4; - if (iface->managed < RELAYD_MANAGED_NO_AFLAG && i != m) + if (iface->managed < RELAYD_MANAGED_NO_AFLAG && i != m && + addrs[i].prefix == 64) continue; if (datalen + entrlen + 4 > buflen || a->assigned == 0) -- 2.25.1