dhcp: NTP servers should be requested by networkd but not implicitly by sd-dhcp

The library so far always requested the NTP servers. This might be
unnecessary in some uses, hence let's move the request into networkd
instead.
This commit is contained in:
Lennart Poettering
2015-08-27 01:17:30 +02:00
parent 0339cd7707
commit 4b7b5abb78
3 changed files with 6 additions and 6 deletions
-1
View File
@@ -105,7 +105,6 @@ static const uint8_t default_req_opts[] = {
DHCP_OPTION_HOST_NAME,
DHCP_OPTION_DOMAIN_NAME,
DHCP_OPTION_DOMAIN_NAME_SERVER,
DHCP_OPTION_NTP_SERVER,
};
static int client_receive_message_raw(sd_event_source *s, int fd,
+1 -4
View File
@@ -87,10 +87,7 @@ static void test_request_basic(sd_event *e)
assert_se(sd_dhcp_client_set_request_option(client,
DHCP_OPTION_DOMAIN_NAME) == -EEXIST);
assert_se(sd_dhcp_client_set_request_option(client,
DHCP_OPTION_DOMAIN_NAME_SERVER)
== -EEXIST);
assert_se(sd_dhcp_client_set_request_option(client,
DHCP_OPTION_NTP_SERVER) == -EEXIST);
DHCP_OPTION_DOMAIN_NAME_SERVER) == -EEXIST);
assert_se(sd_dhcp_client_set_request_option(client,
DHCP_OPTION_PAD) == -EINVAL);
+5 -1
View File
@@ -624,7 +624,11 @@ int dhcp4_configure(Link *link) {
return r;
}
/* Always acquire the timezone */
/* Always acquire the timezone and NTP*/
r = sd_dhcp_client_set_request_option(link->dhcp_client, DHCP_OPTION_NTP_SERVER);
if (r < 0)
return r;
r = sd_dhcp_client_set_request_option(link->dhcp_client, DHCP_OPTION_NEW_TZDB_TIMEZONE);
if (r < 0)
return r;