summaryrefslogtreecommitdiffhomepage
path: root/src/dhcpv6-ia.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dhcpv6-ia.c')
-rw-r--r--src/dhcpv6-ia.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c
index e48123f..3838d54 100644
--- a/src/dhcpv6-ia.c
+++ b/src/dhcpv6-ia.c
@@ -40,6 +40,7 @@
(addrs)[(i)].prefix > 64)
static void dhcpv6_netevent_cb(unsigned long event, struct netevent_handler_info *info);
+static void apply_lease(struct dhcp_assignment *a, bool add);
static void set_border_assignment_size(struct interface *iface, struct dhcp_assignment *b);
static void handle_addrlist_change(struct netevent_handler_info *info);
static void start_reconf(struct dhcp_assignment *a);
@@ -206,6 +207,9 @@ static void dhcpv6_ia_free_assignment(struct dhcp_assignment *a)
close(a->managed_sock.fd.fd);
}
+ if (a->flags & OAF_BOUND && a->length < 128)
+ apply_lease(a, false);
+
if (a->reconf_cnt)
stop_reconf(a);
@@ -1370,13 +1374,13 @@ ssize_t dhcpv6_ia_handle_IAs(uint8_t *buf, size_t buflen, struct interface *ifac
apply_lease(a, true);
}
} else if (hdr->msg_type == DHCPV6_MSG_RELEASE) {
- if (!(a->flags & OAF_STATIC))
- a->valid_until = now - 1;
-
- if (a->flags & OAF_BOUND) {
+ if (a->flags & OAF_STATIC) {
apply_lease(a, false);
a->flags &= ~OAF_BOUND;
}
+ else
+ a->valid_until = now - 1;
+
} else if (hdr->msg_type == DHCPV6_MSG_DECLINE && a->length == 128) {
a->flags &= ~OAF_BOUND;