htons(DHCPV6_OPT_SIP_SERVER_A),
htons(DHCPV6_OPT_DNS_SERVERS),
htons(DHCPV6_OPT_DNS_DOMAIN),
+ htons(DHCPV6_OPT_SNTP_SERVERS),
htons(DHCPV6_OPT_NTP_SERVER),
htons(DHCPV6_OPT_AFTR_NAME),
htons(DHCPV6_OPT_PD_EXCLUDE),
odhcp6c_clear_state(STATE_DNS);
odhcp6c_clear_state(STATE_SEARCH);
odhcp6c_clear_state(STATE_SNTP_IP);
- odhcp6c_clear_state(STATE_SNTP_FQDN);
+ odhcp6c_clear_state(STATE_NTP_IP);
+ odhcp6c_clear_state(STATE_NTP_FQDN);
odhcp6c_clear_state(STATE_SIP_IP);
odhcp6c_clear_state(STATE_SIP_FQDN);
odhcp6c_clear_state(STATE_AFTR_NAME);
odhcp6c_add_state(STATE_DNS, odata, olen);
} else if (otype == DHCPV6_OPT_DNS_DOMAIN) {
odhcp6c_add_state(STATE_SEARCH, odata, olen);
+ } else if (otype == DHCPV6_OPT_SNTP_SERVERS) {
+ if (olen % 16 == 0)
+ odhcp6c_add_state(STATE_SNTP_IP, odata, olen);
} else if (otype == DHCPV6_OPT_NTP_SERVER) {
uint16_t stype, slen;
uint8_t *sdata;
stype, slen, sdata) {
if (slen == 16 && (stype == NTP_MC_ADDR ||
stype == NTP_SRV_ADDR))
- odhcp6c_add_state(STATE_SNTP_IP,
+ odhcp6c_add_state(STATE_NTP_IP,
sdata, slen);
else if (slen > 0 && stype == NTP_SRV_FQDN)
- odhcp6c_add_state(STATE_SNTP_FQDN,
+ odhcp6c_add_state(STATE_NTP_FQDN,
sdata, slen);
}
} else if (otype == DHCPV6_OPT_SIP_SERVER_A) {
odhcp6c_clear_state(STATE_IA_NA);
odhcp6c_clear_state(STATE_IA_PD);
odhcp6c_clear_state(STATE_SNTP_IP);
- odhcp6c_clear_state(STATE_SNTP_FQDN);
+ odhcp6c_clear_state(STATE_NTP_IP);
+ odhcp6c_clear_state(STATE_NTP_FQDN);
odhcp6c_clear_state(STATE_SIP_IP);
odhcp6c_clear_state(STATE_SIP_FQDN);
dhcpv6_set_ia_mode(ia_na_mode, ia_pd_mode);
DHCPV6_OPT_DNS_DOMAIN = 24,
DHCPV6_OPT_IA_PD = 25,
DHCPV6_OPT_IA_PREFIX = 26,
+ DHCPV6_OPT_SNTP_SERVERS = 31,
DHCPV6_OPT_INFO_REFRESH = 32,
DHCPV6_OPT_FQDN = 39,
DHCPV6_OPT_NTP_SERVER = 56,
STATE_IA_PD,
STATE_CUSTOM_OPTS,
STATE_SNTP_IP,
- STATE_SNTP_FQDN,
+ STATE_NTP_IP,
+ STATE_NTP_FQDN,
STATE_SIP_IP,
STATE_SIP_FQDN,
STATE_RA_ROUTE,
void script_call(const char *status)
{
- size_t dns_len, search_len, custom_len, sntp_ip_len, sntp_dns_len;
+ size_t dns_len, search_len, custom_len, sntp_ip_len, ntp_ip_len, ntp_dns_len;
size_t sip_ip_len, sip_fqdn_len, aftr_name_len;
odhcp6c_expire();
uint8_t *search = odhcp6c_get_state(STATE_SEARCH, &search_len);
uint8_t *custom = odhcp6c_get_state(STATE_CUSTOM_OPTS, &custom_len);
struct in6_addr *sntp = odhcp6c_get_state(STATE_SNTP_IP, &sntp_ip_len);
- uint8_t *sntp_dns = odhcp6c_get_state(STATE_SNTP_FQDN, &sntp_dns_len);
+ struct in6_addr *ntp = odhcp6c_get_state(STATE_NTP_IP, &ntp_ip_len);
+ uint8_t *ntp_dns = odhcp6c_get_state(STATE_NTP_FQDN, &ntp_dns_len);
struct in6_addr *sip = odhcp6c_get_state(STATE_SIP_IP, &sip_ip_len);
uint8_t *sip_fqdn = odhcp6c_get_state(STATE_SIP_FQDN, &sip_fqdn_len);
uint8_t *aftr_name = odhcp6c_get_state(STATE_AFTR_NAME, &aftr_name_len);
if (fork() == 0) {
ipv6_to_env("RDNSS", dns, dns_len / sizeof(*dns));
ipv6_to_env("SNTP_IP", sntp, sntp_ip_len / sizeof(*sntp));
+ ipv6_to_env("NTP_IP", ntp, ntp_ip_len / sizeof(*ntp));
+ fqdn_to_env("NTP_FQDN", ntp_dns, ntp_dns_len);
ipv6_to_env("SIP_IP", sip, sip_ip_len / sizeof(*sip));
fqdn_to_env("DOMAINS", search, search_len);
- fqdn_to_env("SNTP_FQDN", sntp_dns, sntp_dns_len);
fqdn_to_env("SIP_DOMAIN", sip_fqdn, sip_fqdn_len);
fqdn_to_env("AFTR", aftr_name, aftr_name_len);
fqdn_to_ip_env("AFTR_IP", aftr_name, aftr_name_len);