From: Michael Tremer Date: Mon, 30 Jan 2023 03:20:23 +0000 (+0000) Subject: networkd: Read main configuration file X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ac78f288a7c1f8b363cf0c86fc196aeeb8e8264;p=network.git networkd: Read main configuration file Signed-off-by: Michael Tremer --- diff --git a/src/networkd/daemon.c b/src/networkd/daemon.c index 3aee8caf..bd5f1f00 100644 --- a/src/networkd/daemon.c +++ b/src/networkd/daemon.c @@ -26,12 +26,15 @@ #include #include "bus.h" +#include "config.h" #include "daemon.h" #include "logging.h" struct nw_daemon { int nrefs; + struct nw_config* config; + // Event Loop sd_event* loop; @@ -105,6 +108,11 @@ static int nw_daemon_setup_loop(struct nw_daemon* daemon) { static int nw_daemon_setup(struct nw_daemon* daemon) { int r; + // Read configuration file + r = nw_config_read(&daemon->config, "/etc/network/settings"); + if (r) + return r; + // Setup the event loop r = nw_daemon_setup_loop(daemon); if (r) @@ -145,6 +153,8 @@ ERROR: } static void nw_daemon_free(struct nw_daemon* daemon) { + if (daemon->config) + nw_config_unref(daemon->config); if (daemon->bus) sd_bus_unref(daemon->bus); if (daemon->loop)