1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-26 03:22:00 +03:00

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.
This commit is contained in:
Lennart Poettering 2014-08-15 15:42:56 +02:00
parent f15b6e5a8b
commit d5314fff96

View File

@ -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",