summaryrefslogtreecommitdiffhomepage
path: root/src/config.c
diff options
context:
space:
mode:
authorDainis Jonitis <dainis.jonitis@ubnt.com>2019-04-29 14:40:14 +0300
committerHans Dedecker <dedeckeh@gmail.com>2019-05-03 14:51:52 +0200
commita2dd8d6bd918fb211db491c7dcb1810032f3f8ca (patch)
treeee6e81ddf764b091231cd6d38eedfb671e23350a /src/config.c
parenta17665eaabee92b04b947bb68b8717b18ace6615 (diff)
treewide: always init interface list heads during initialization
When allocating interface, init dhcpv4_assignments, dhcpv4_fr_ips and ia_assignments circular list heads to point to self. Avoids checking whether next pointer is not null all over the place. Signed-off-by: Dainis Jonitis <dainis.jonitis@ubnt.com>
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index 399922b..dfeadac 100644
--- a/src/config.c
+++ b/src/config.c
@@ -440,6 +440,10 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
iface->ndp_event.uloop.fd = -1;
iface->ndp_ping_fd = -1;
iface->dhcpv4_event.uloop.fd = -1;
+ INIT_LIST_HEAD(&iface->ia_assignments);
+ INIT_LIST_HEAD(&iface->dhcpv4_assignments);
+ INIT_LIST_HEAD(&iface->dhcpv4_fr_ips);
+
set_interface_defaults(iface);
avl_insert(&interfaces, &iface->avl);