t1 = t2 = t3 = 86400;
size_t ia_na_len, dns_len, search_len, sntp_ip_len, sntp_dns_len;
+ size_t sip_ip_len, sip_fqdn_len;
uint8_t *ia_na = odhcp6c_get_state(STATE_IA_NA, &ia_na_len);
uint8_t *ia_end;
odhcp6c_get_state(STATE_DNS, &dns_len);
odhcp6c_get_state(STATE_SEARCH, &search_len);
odhcp6c_get_state(STATE_SNTP_IP, &sntp_ip_len);
odhcp6c_get_state(STATE_SNTP_FQDN, &sntp_dns_len);
+ odhcp6c_get_state(STATE_SIP_IP, &sip_ip_len);
+ odhcp6c_get_state(STATE_SIP_FQDN, &sip_fqdn_len);
// Decrease valid and preferred lifetime of prefixes
size_t ia_pd_len;
t3 = n;
} else if (otype == DHCPV6_OPT_DNS_SERVERS) {
- odhcp6c_add_state(STATE_DNS, odata, olen);
+ if (olen == 16)
+ 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_NTP_SERVER) {
odhcp6c_add_state(STATE_SNTP_FQDN,
sdata, slen);
}
+ } else if (otype == DHCPV6_OPT_SIP_SERVER_A) {
+ if (olen == 16)
+ odhcp6c_add_state(STATE_SIP_IP, odata, olen);
+ } else if (otype == DHCPV6_OPT_SIP_SERVER_D) {
+ odhcp6c_add_state(STATE_SIP_FQDN, odata, olen);
} else if (otype == DHCPV6_OPT_INFO_REFRESH && olen >= 4) {
uint32_t refresh = ntohl(*((uint32_t*)odata));
if (refresh < (uint32_t)t1)
sntp_ip_len);
have_update |= odhcp6c_commit_state(STATE_SNTP_FQDN,
sntp_dns_len);
+ have_update |= odhcp6c_commit_state(STATE_SIP_IP, sip_ip_len);
+ have_update |= odhcp6c_commit_state(STATE_SIP_FQDN, sip_fqdn_len);
size_t new_ia_pd_len, new_ia_na_len;
odhcp6c_get_state(STATE_IA_PD, &new_ia_pd_len);
odhcp6c_get_state(STATE_IA_NA, &new_ia_na_len);
odhcp6c_clear_state(STATE_IA_PD_LOST);
odhcp6c_clear_state(STATE_SNTP_IP);
odhcp6c_clear_state(STATE_SNTP_FQDN);
+ odhcp6c_clear_state(STATE_SIP_IP);
+ odhcp6c_clear_state(STATE_SIP_FQDN);
dhcpv6_set_ia_na_mode(ia_na_mode);
alarm(timeout);
DHCPV6_OPT_INFO_REFRESH = 32,
DHCPV6_OPT_FQDN = 39,
DHCPV6_OPT_NTP_SERVER = 56,
+ DHCPV6_OPT_SIP_SERVER_D = 21,
+ DHCPV6_OPT_SIP_SERVER_A = 22,
};
enum dhcpv6_opt_npt {
STATE_CUSTOM_OPTS,
STATE_SNTP_IP,
STATE_SNTP_FQDN,
+ STATE_SIP_IP,
+ STATE_SIP_FQDN,
_STATE_MAX
};
{
syslog(LOG_WARNING, "State for %s changed to %s", argv[1], status);
size_t dns_len, search_len, custom_len, sntp_ip_len, sntp_dns_len;
+ size_t sip_ip_len, sip_fqdn_len;
+
struct in6_addr *dns = odhcp6c_get_state(STATE_DNS, &dns_len);
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 *sip = odhcp6c_get_state(STATE_SIP_IP, &sip_ip_len);
+ uint8_t *sip_fqdn = odhcp6c_get_state(STATE_SIP_FQDN, &sip_fqdn_len);
size_t prefix_len, lost_pd_len;
uint8_t *prefix = odhcp6c_get_state(STATE_IA_PD, &prefix_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("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);
bin_to_env(custom, custom_len);
prefix_to_env("PREFIXES", prefix, prefix_len);
prefix_to_env("PREFIXES_LOST", lost_pd, lost_pd_len);