mac addresses were never flushed

Signed-off-by: John Crispin <[email protected]>
This commit is contained in:
John Crispin
2023-03-15 15:21:44 +01:00
parent 3d2b67b180
commit 979aca4764
9 changed files with 129 additions and 6 deletions
+22
View File
@@ -111,6 +111,14 @@ dhcpv4_release(struct blob_attr *msg)
free(dhcpv4);
}
void
dhcpv4_del(struct dhcpv4 *dhcpv4)
{
list_del(&dhcpv4->mac);
avl_delete(&dhcpv4_tree, &dhcpv4->avl);
free(dhcpv4);
}
void
dhcp_init(void)
{
@@ -136,4 +144,18 @@ dhcp_init(void)
dhcpv4_add(addr, ip, hostname, NULL);
}
fclose(fp);
}
void
dhcp_done(void)
{
struct dhcpv4 *d, *t;
avl_for_each_element_safe(&dhcpv4_tree, d, avl, t) {
avl_delete(&dhcpv4_tree, &d->avl);
free(d);
}
}