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:
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user