diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2020-12-24 15:41:37 +0100 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2020-12-24 15:54:25 +0100 |
commit | 9d5e37912820443492f87f07fb68edeed206c044 (patch) | |
tree | 2b4f4a8cab3389733fc798d5ad7ef928562b25ee /src | |
parent | 2cf6232fd170a24b801d71d497947d7aabd12015 (diff) |
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 <dedeckeh@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/dhcpv6-ia.c | 6 |
1 files 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(); |