summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-01-13 21:28:53 +0100
committerTom Gundersen <teg@jklm.no>2014-01-13 21:54:57 +0100
commit5be4d38e31281727b6f45ae869136bb01a1f7790 (patch)
tree13b707ff2040872ef6c4fde4d8de636f02185ef4 /src/network/networkd-link.c
parent5681d7fb8be37771c152d21ea6e95597d664e3f1 (diff)
networkd: DHCPv4 - allow opting out of using DNS servers
Setting UseDNS=no will ignore any received DNS servers.
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 5dd8e91007..6186f7f892 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -319,6 +319,7 @@ static void dhcp_handler(sd_dhcp_client *client, int event, void *userdata) {
int r;
assert(link);
+ assert(link->network);
if (link->state == LINK_STATE_FAILED)
return;
@@ -421,11 +422,13 @@ static void dhcp_handler(sd_dhcp_client *client, int event, void *userdata) {
addr = NULL;
rt = NULL;
- r = sd_dhcp_client_get_dns(client, &nameservers);
- if (r >= 0) {
- r = manager_update_resolv_conf(link->manager);
- if (r < 0)
- log_error("Failed to update resolv.conf");
+ if (link->network->dhcp_dns) {
+ r = sd_dhcp_client_get_dns(client, &nameservers);
+ if (r >= 0) {
+ r = manager_update_resolv_conf(link->manager);
+ if (r < 0)
+ log_error("Failed to update resolv.conf");
+ }
}
link_enter_set_addresses(link);