buf[buf_len++] = '=';
for (size_t i = 0; i < len / sizeof(*e); ++i) {
+ /*
+ * The only invalid entries allowed to be passed to the script are prefix entries.
+ * This will allow immediate removal of the old ipv6-prefix-assignment that might
+ * otherwise be kept for up to 2 hours (see L-13 requirement of RFC 7084).
+ */
+ if (!e[i].valid && type != ENTRY_PREFIX)
+ continue;
+
inet_ntop(AF_INET6, &e[i].target, &buf[buf_len], INET6_ADDRSTRLEN);
buf_len += strlen(&buf[buf_len]);
(uint8_t*)e < &start[len] &&
(uint8_t*)odhcp6c_next_entry(e) <= &start[len];
e = odhcp6c_next_entry(e)) {
+ if (!e->valid)
+ continue;
c = mempcpy(c, e->auxtarget, e->auxlen);
*c++ = ' ';
}
bool running_script = false;
if (running) {
+ time_t diff = now - started;
+
kill(running, SIGTERM);
- delay -= now - started;
+
+ if (diff > delay)
+ delay -= diff;
+ else
+ delay = 0;
+
running_script = true;
}
signal(SIGTERM, SIG_DFL);
if (delay > 0) {
sleep(delay);
- odhcp6c_expire();
+ odhcp6c_expire(false);
}
struct in6_addr *addr = odhcp6c_get_state(STATE_SERVER_ADDR, &addr_len);
entry_to_env("RA_DNS", ra_dns, ra_dns_len, ENTRY_HOST);
search_to_env("RA_DOMAINS", ra_search, ra_search_len);
- int_to_env("RA_HOPLIMIT", ra_conf_hoplimit(0));
- int_to_env("RA_MTU", ra_conf_mtu(0));
- int_to_env("RA_REACHABLE", ra_conf_reachable(0));
- int_to_env("RA_RETRANSMIT", ra_conf_retransmit(0));
+ int_to_env("RA_HOPLIMIT", ra_get_hoplimit());
+ int_to_env("RA_MTU", ra_get_mtu());
+ int_to_env("RA_REACHABLE", ra_get_reachable());
+ int_to_env("RA_RETRANSMIT", ra_get_retransmit());
char *buf = malloc(10 + passthru_len * 2);
strncpy(buf, "PASSTHRU=", 10);