summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/sd-dhcp-lease.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-07-23 13:48:18 +0200
committerTom Gundersen <teg@jklm.no>2014-07-23 23:54:51 +0200
commitb0e39c8284b5195850a58e4efcce2f059bdcc6ad (patch)
treee5f1183bec258450f9cd59ce1a8e255179467e0d /src/libsystemd-network/sd-dhcp-lease.c
parent36d054aae0847df38687640909304dde1452b22d (diff)
networkd: merge DNS and NTP entries when exporting
In the state files, do not distinguish where the various entries came from (static or DHCP), but include them all in the same list.
Diffstat (limited to 'src/libsystemd-network/sd-dhcp-lease.c')
-rw-r--r--src/libsystemd-network/sd-dhcp-lease.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c
index 4ed30f5d03..bfd1b0cd18 100644
--- a/src/libsystemd-network/sd-dhcp-lease.c
+++ b/src/libsystemd-network/sd-dhcp-lease.c
@@ -629,13 +629,17 @@ int dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file) {
if (r >= 0)
fprintf(f, "MTU=%" PRIu16 "\n", mtu);
+ fputs("DNS=", f);
r = sd_dhcp_lease_get_dns(lease, &addresses);
if (r >= 0)
- serialize_in_addrs(f, "DNS", addresses, r);
+ serialize_in_addrs(f, addresses, r);
+ fputs("\n", f);
+ fputs("NTP=", f);
r = sd_dhcp_lease_get_ntp(lease, &addresses);
if (r >= 0)
- serialize_in_addrs(f, "NTP", addresses, r);
+ serialize_in_addrs(f, addresses, r);
+ fputs("\n", f);
r = sd_dhcp_lease_get_domainname(lease, &string);
if (r >= 0)