chiark / gitweb /
networkd: manager - read fallback DNS servers from config file
[elogind.git] / src / network / networkd-network.c
index 76381c4f6c576b3d6807cca4252262751f26f702..12107c940604c4b0c498038f7690b2a14caa3885 100644 (file)
@@ -77,10 +77,6 @@ static int network_load_one(Manager *manager, const char *filename) {
         if (!network->routes_by_section)
                 return log_oom();
 
-        network->dns = set_new(NULL, NULL);
-        if (!network->dns)
-                return log_oom();
-
         network->filename = strdup(filename);
         if (!network->filename)
                 return log_oom();
@@ -98,7 +94,7 @@ static int network_load_one(Manager *manager, const char *filename) {
 
         LIST_PREPEND(networks, manager->networks, network);
 
-        LIST_FOREACH(static_routes, route, network->static_routes) {
+        LIST_FOREACH(routes, route, network->static_routes) {
                 if (!route->family) {
                         log_warning("Route section without Gateway field configured in %s. "
                                     "Ignoring", filename);
@@ -106,7 +102,7 @@ static int network_load_one(Manager *manager, const char *filename) {
                 }
         }
 
-        LIST_FOREACH(static_addresses, address, network->static_addresses) {
+        LIST_FOREACH(addresses, address, network->static_addresses) {
                 if (!address->family) {
                         log_warning("Address section without Address field configured in %s. "
                                     "Ignoring", filename);
@@ -164,10 +160,10 @@ void network_free(Network *network) {
 
         free(network->description);
 
-        SET_FOREACH(address, network->dns, i)
+        while ((address = network->dns)) {
+                LIST_REMOVE(addresses, network->dns, address);
                 address_free(address);
-
-        set_free(network->dns);
+        }
 
         netdev_unref(network->bridge);