dhcpv6-ia: fix prefix delegation behavior
authorHans Dedecker <dedeckeh@gmail.com>
Thu, 24 Dec 2020 14:41:37 +0000 (15:41 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Thu, 24 Dec 2020 14:54:25 +0000 (15:54 +0100)
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 <dedeckeh@gmail.com>
src/dhcpv6-ia.c

index 7ca8e4faad2b5a73c5563eb28191a6f1239b7fe6..2de971070df10008965a190d693fae223a133eb8 100644 (file)
@@ -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();