From 9d5e37912820443492f87f07fb68edeed206c044 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Thu, 24 Dec 2020 15:41:37 +0100 Subject: [PATCH] dhcpv6-ia: fix prefix delegation behavior When an IPv6 address change is triggered each PD assignment is checked if it is still consistent with the updated IPv6 prefix list. If not consistent anymore a reconfigure is triggered for the assignment and a best effort is made to assign a new IA_PD prefix. If it not possible anymore to assign an IA_PD prefix delete the PD assignment now so it will result into a NO BINDING status code for the given IA_PD in the DHCPv6 reply when the client tries to renew the IA_PD prefix. Signed-off-by: Hans Dedecker --- src/dhcpv6-ia.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c index 7ca8e4f..2de9710 100644 --- a/src/dhcpv6-ia.c +++ b/src/dhcpv6-ia.c @@ -734,10 +734,8 @@ static void handle_addrlist_change(struct netevent_handler_info *info) while (!list_empty(&reassign)) { c = list_first_entry(&reassign, struct dhcp_assignment, head); list_del_init(&c->head); - if (!assign_pd(iface, c)) { - c->assigned = 0; - list_add(&c->head, &iface->ia_assignments); - } + if (!assign_pd(iface, c)) + free_assignment(c); } dhcpv6_ia_write_statefile(); -- 2.30.2