From 06f021a8048583d66202e3ac5cd0a12386d33ac2 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Thu, 13 Mar 2014 20:46:45 +0100 Subject: networkd: allow more than one static DNS server --- src/network/networkd-network.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/network/networkd-network.c') diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 6437ff4230..6e9915b75d 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -69,6 +69,10 @@ 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(); @@ -136,6 +140,7 @@ int network_load(Manager *manager) { void network_free(Network *network) { Route *route; Address *address; + Iterator i; if (!network) return; @@ -150,7 +155,10 @@ void network_free(Network *network) { free(network->description); - address_free(network->dns); + SET_FOREACH(address, network->dns, i) + address_free(address); + + set_free(network->dns); hashmap_free(network->vlans); -- cgit v1.2.3-54-g00ecf