if (assign->assigned >= current && assign->assigned + asize < c->assigned) {
list_add_tail(&assign->head, &c->head);
- apply_lease(iface, assign, true);
+
+ if (assign->flags & OAF_BOUND)
+ apply_lease(iface, assign, true);
+
return true;
}
if (current + asize < c->assigned) {
assign->assigned = current;
list_add_tail(&assign->head, &c->head);
- apply_lease(iface, assign, true);
+
+ if (assign->flags & OAF_BOUND)
+ apply_lease(iface, assign, true);
+
return true;
}
&iface->ia_assignments, struct dhcpv6_assignment, head);
list_for_each_entry(c, &iface->ia_assignments, head)
- if (c != border && !iface->managed)
+ if (c != border && !iface->managed && (c->flags & OAF_BOUND))
apply_lease(iface, c, false);
}
if (c->length < 128 && c->assigned >= border->assigned && c != border)
list_move(&c->head, &reassign);
- else if (c != border)
+ else if (c != border && (c->flags & OAF_BOUND))
apply_lease(iface, c, true);
if (c->accept_reconf && c->reconf_cnt == 0) {
a = c;
/* Reset state */
- apply_lease(iface, a, false);
+ if (a->flags & OAF_BOUND)
+ apply_lease(iface, a, false);
+
memcpy(a->clid_data, clid_data, clid_len);
a->clid_len = clid_len;
a->iaid = ia->iaid;
if (!(a->flags & OAF_STATIC))
a->valid_until = now - 1;
- a->flags &= ~OAF_BOUND;
- apply_lease(iface, a, false);
+ if (a->flags & OAF_BOUND) {
+ apply_lease(iface, a, false);
+ a->flags &= ~OAF_BOUND;
+ }
} else if (hdr->msg_type == DHCPV6_MSG_DECLINE && a->length == 128) {
a->flags &= ~OAF_BOUND;