network:dhcp4: request domain search list if UseDomains=yes
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 14 Jul 2019 01:29:40 +0000 (10:29 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 14 Jul 2019 13:08:29 +0000 (22:08 +0900)
Closes #8174.

src/network/networkd-dhcp4.c

index 7ed91ce..5ada9f0 100644 (file)
@@ -1041,6 +1041,12 @@ int dhcp4_configure(Link *link) {
                         return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for classless static route: %m");
         }
 
+        if (link->network->dhcp_use_domains != DHCP_USE_DOMAINS_NO && !link->network->dhcp_anonymize) {
+                r = sd_dhcp_client_set_request_option(link->dhcp_client, SD_DHCP_OPTION_DOMAIN_SEARCH_LIST);
+                if (r < 0)
+                        return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set request flag for domain search list: %m");
+        }
+
         if (link->network->dhcp_use_ntp) {
                 r = sd_dhcp_client_set_request_option(link->dhcp_client, SD_DHCP_OPTION_NTP_SERVER);
                 if (r < 0)