summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-15 15:42:56 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-15 15:42:56 +0200
commitd5314fff96221c1b32e4d7c21eba9798dab58764 (patch)
treec8fd34a87e30a83bac582a7423c77adfefe0ceb3 /src/network
parentf15b6e5a8b6e550c6df7f6ccc216d5c4cbe6a604 (diff)
networkd: always write out locally configured settings first, dhcp-acquired ones later
This is primarily important for the domains list, as we really should prefer the locally configured domain over the dhcp supplied ones when we use it as a search list.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-link.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 76e642758d..a37561a04a 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1726,6 +1726,10 @@ int link_save(Link *link) {
fputs("DNS=", f);
+ STRV_FOREACH(address, link->network->dns)
+ fprintf(f, "%s%s", *address,
+ (address + 1 ? " " : ""));
+
if (link->network->dhcp_dns &&
link->dhcp_lease) {
const struct in_addr *addresses;
@@ -1738,14 +1742,14 @@ int link_save(Link *link) {
}
}
- STRV_FOREACH(address, link->network->dns)
- fprintf(f, "%s%s", *address,
- (address + 1 ? " " : ""));
-
fputs("\n", f);
fprintf(f, "NTP=");
+ STRV_FOREACH(address, link->network->ntp)
+ fprintf(f, "%s%s", *address,
+ (address + 1 ? " " : ""));
+
if (link->network->dhcp_ntp &&
link->dhcp_lease) {
const struct in_addr *addresses;
@@ -1758,14 +1762,14 @@ int link_save(Link *link) {
}
}
- STRV_FOREACH(address, link->network->ntp)
- fprintf(f, "%s%s", *address,
- (address + 1 ? " " : ""));
-
fputs("\n", f);
fprintf(f, "DOMAINS=");
+ STRV_FOREACH(domain, link->network->domains)
+ fprintf(f, "%s%s", *domain,
+ (domain + 1 ? " " : ""));
+
if (link->network->dhcp_domains &&
link->dhcp_lease) {
const char *domainname;
@@ -1778,10 +1782,6 @@ int link_save(Link *link) {
}
}
- STRV_FOREACH(domain, link->network->domains)
- fprintf(f, "%s%s", *domain,
- (domain + 1 ? " " : ""));
-
fputs("\n", f);
fprintf(f, "WILDCARD_DOMAIN=%s\n",