From: Hans Dedecker Date: Tue, 27 Aug 2019 20:00:26 +0000 (+0200) Subject: dhcpv6-ia: free assignment when validity timer expires X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=94a1c942315f6b3c2870cf744114bb133f209799;p=oweals%2Fodhcpd.git dhcpv6-ia: free assignment when validity timer expires In case clid_len is set free assignment when validity timer expires Signed-off-by: Hans Dedecker --- diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c index 55b3cd4..0adc57f 100644 --- a/src/dhcpv6-ia.c +++ b/src/dhcpv6-ia.c @@ -772,12 +772,8 @@ static void valid_until_cb(struct uloop_timeout *event) continue; list_for_each_entry_safe(a, n, &iface->ia_assignments, head) { - if (!INFINITE_VALID(a->valid_until) && a->valid_until < now) { - if ((a->length < 128 && a->clid_len > 0) || - (a->length == 128 && a->clid_len == 0)) - free_assignment(a); - - } + if (a->clid_len > 0 && !INFINITE_VALID(a->valid_until) && a->valid_until < now) + free_assignment(a); } } uloop_timeout_set(event, 1000); @@ -1384,7 +1380,7 @@ ssize_t dhcpv6_ia_handle_IAs(uint8_t *buf, size_t buflen, struct interface *ifac a->flags &= ~OAF_BOUND; if (!(a->flags & OAF_STATIC)) { - a->clid_len = 0; + memset(a->clid_data, 0, a->clid_len); a->valid_until = now + 3600; /* Block address for 1h */ } }