diff options
author | Tom Gundersen <teg@jklm.no> | 2014-03-13 20:46:45 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-03-14 12:44:17 +0100 |
commit | 06f021a8048583d66202e3ac5cd0a12386d33ac2 (patch) | |
tree | 407112a3da562091ca371ebd1cff2e9f5bf3faf8 /src/network/networkd-network.c | |
parent | 0ea51a1129b9984a3c6d96cef1b0e33c99b5e9cf (diff) |
networkd: allow more than one static DNS server
Diffstat (limited to 'src/network/networkd-network.c')
-rw-r--r-- | src/network/networkd-network.c | 10 |
1 files changed, 9 insertions, 1 deletions
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); |