]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/network/networkd-network.c
networkd/sd-network: expose statically configured NTP servers
[thirdparty/systemd.git] / src / network / networkd-network.c
index 1b8856afebdd9397b8a783f719a9616e779266f6..a6cbee239770fa59abc08c1a25fe6c49a2dc80c7 100644 (file)
@@ -81,6 +81,7 @@ static int network_load_one(Manager *manager, const char *filename) {
         if (!network->filename)
                 return log_oom();
 
+        network->dhcp_ntp = true;
         network->dhcp_dns = true;
         network->dhcp_hostname = true;
         network->dhcp_domainname = true;
@@ -160,6 +161,11 @@ void network_free(Network *network) {
 
         free(network->description);
 
+        while ((address = network->ntp)) {
+                LIST_REMOVE(addresses, network->ntp, address);
+                address_free(address);
+        }
+
         while ((address = network->dns)) {
                 LIST_REMOVE(addresses, network->dns, address);
                 address_free(address);
@@ -234,7 +240,7 @@ int network_apply(Manager *manager, Network *network, Link *link) {
 
         link->network = network;
 
-        if (network->dns) {
+        if (network->dns || network->ntp) {
                 r = link_save(link);
                 if (r < 0)
                         return r;