summaryrefslogtreecommitdiffhomepage
path: root/src/dhcpv4.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2019-02-05 12:09:44 +0100
committerHans Dedecker <dedeckeh@gmail.com>2019-02-05 16:38:23 +0100
commit9f25dd8af76dc30e54ddcbb4a284058e598951d5 (patch)
tree63c568f94b71069bff3e25c59eed4a148f382a59 /src/dhcpv4.c
parentf21a0a7bbc31ff8b519e566087e5b425c39480c6 (diff)
treewide: use avl tree to store interfaces
Store the interfaces in an avl tree iso a linear linked list Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/dhcpv4.c')
-rw-r--r--src/dhcpv4.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dhcpv4.c b/src/dhcpv4.c
index 4a74b8a..e29f490 100644
--- a/src/dhcpv4.c
+++ b/src/dhcpv4.c
@@ -412,9 +412,10 @@ static bool leases_require_fr(struct interface *iface, struct odhcpd_ipaddr *add
static void valid_until_cb(struct uloop_timeout *event)
{
- time_t now = odhcpd_time();
struct interface *iface;
- list_for_each_entry(iface, &interfaces, head) {
+ time_t now = odhcpd_time();
+
+ avl_for_each_element(&interfaces, iface, avl) {
if (iface->dhcpv4 != MODE_SERVER || iface->dhcpv4_assignments.next == NULL)
continue;