diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2019-08-27 22:00:26 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2019-08-28 19:13:37 +0200 |
commit | 94a1c942315f6b3c2870cf744114bb133f209799 (patch) | |
tree | f7627a2eb20bbb1f18c103e0061577c22aa02336 /src/dhcpv6-ia.c | |
parent | 752fc2c278dc01f0b3ed2faf67a11f9bc1f3c627 (diff) |
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 <dedeckeh@gmail.com>
Diffstat (limited to 'src/dhcpv6-ia.c')
-rw-r--r-- | src/dhcpv6-ia.c | 10 |
1 files changed, 3 insertions, 7 deletions
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 */ } } |