summaryrefslogtreecommitdiff
path: root/src/resolve
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/resolve
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/resolve')
-rw-r--r--src/resolve/resolved-link.c52
1 files changed, 0 insertions, 52 deletions
diff --git a/src/resolve/resolved-link.c b/src/resolve/resolved-link.c
index 078301aa26..43f60d8bb6 100644
--- a/src/resolve/resolved-link.c
+++ b/src/resolve/resolved-link.c
@@ -136,57 +136,6 @@ int link_update_rtnl(Link *l, sd_rtnl_message *m) {
return 0;
}
-static int link_update_dhcp_dns_servers(Link *l) {
- _cleanup_dhcp_lease_unref_ sd_dhcp_lease *lease = NULL;
- const struct in_addr *nameservers = NULL;
- DnsServer *s, *nx;
- int r, n, i;
-
- assert(l);
-
- r = sd_network_dhcp_use_dns(l->ifindex);
- if (r <= 0)
- goto clear;
-
- r = sd_network_get_dhcp_lease(l->ifindex, &lease);
- if (r < 0)
- goto clear;
-
- LIST_FOREACH(servers, s, l->dhcp_dns_servers)
- s->marked = true;
-
- n = sd_dhcp_lease_get_dns(lease, &nameservers);
- if (n < 0) {
- r = n;
- goto clear;
- }
-
- for (i = 0; i < n; i++) {
- union in_addr_union a = { .in = nameservers[i] };
-
- s = link_find_dns_server(l, DNS_SERVER_DHCP, AF_INET, &a);
- if (s)
- s->marked = false;
- else {
- r = dns_server_new(l->manager, NULL, DNS_SERVER_DHCP, l, AF_INET, &a);
- if (r < 0)
- goto clear;
- }
- }
-
- LIST_FOREACH_SAFE(servers, s, nx, l->dhcp_dns_servers)
- if (s->marked)
- dns_server_free(s);
-
- return 0;
-
-clear:
- while (l->dhcp_dns_servers)
- dns_server_free(l->dhcp_dns_servers);
-
- return r;
-}
-
static int link_update_link_dns_servers(Link *l) {
_cleanup_free_ struct in_addr *nameservers = NULL;
_cleanup_free_ struct in6_addr *nameservers6 = NULL;
@@ -252,7 +201,6 @@ clear:
int link_update_monitor(Link *l) {
assert(l);
- link_update_dhcp_dns_servers(l);
link_update_link_dns_servers(l);
link_allocate_scopes(l);