From 41e4615d4f4f5c61afa84ba857f23c0ac496687b Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Fri, 10 Apr 2015 16:17:22 +0300 Subject: sd-dhcp6: Support deprecated SNTP Configuration Option Although the SNTP option specified in RFC 4075 has been deprecated, some servers are still sending NTP information with this option. Use the SNTP information provided only if the NTP option is not present. Update the test case as SNTP information is also requested. --- src/libsystemd-network/sd-dhcp6-client.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/libsystemd-network/sd-dhcp6-client.c') diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index 986958d8ad..bc17c6adc5 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/libsystemd-network/sd-dhcp6-client.c @@ -73,6 +73,7 @@ static const uint16_t default_req_opts[] = { DHCP6_OPTION_DNS_SERVERS, DHCP6_OPTION_DOMAIN_LIST, DHCP6_OPTION_NTP_SERVER, + DHCP6_OPTION_SNTP_SERVERS, }; const char * dhcp6_message_type_table[_DHCP6_MESSAGE_MAX] = { @@ -774,6 +775,13 @@ static int client_parse_message(sd_dhcp6_client *client, return r; break; + + case DHCP6_OPTION_SNTP_SERVERS: + r = dhcp6_lease_set_sntp(lease, optval, optlen); + if (r < 0) + return r; + + break; } } -- cgit v1.2.3-54-g00ecf