if ((a->flags & OAF_BOUND) && (a->flags & OAF_DHCPV6_PD))
apply_lease(a, false);
- if (a->reconf_cnt)
+ if (a->fr_cnt)
stop_reconf(a);
free(a->managed);
end[-1] = 0;
c->managed_size = 0;
- if (c->accept_reconf)
- c->reconf_cnt = 1;
+ if (c->accept_fr_nonce)
+ c->fr_cnt = 1;
char *saveptr;
for (char *line = strtok_r(data, "\n", &saveptr); line; line = strtok_r(NULL, "\n", &saveptr)) {
c->managed_size = 0;
- if (c->accept_reconf)
- c->reconf_cnt = 1;
+ if (c->accept_fr_nonce)
+ c->fr_cnt = 1;
}
static bool assign_pd(struct interface *iface, struct dhcp_assignment *assign)
else if (c->flags & OAF_BOUND)
apply_lease(c, true);
- if (c->accept_reconf && c->reconf_cnt == 0) {
+ if (c->accept_fr_nonce && c->fr_cnt == 0) {
struct dhcp_assignment *a;
start_reconf(c);
list_for_each_entry(a, &iface->ia_assignments, head)
if (a != c && a->clid_len == c->clid_len &&
!memcmp(a->clid_data, c->clid_data, a->clid_len))
- a->reconf_cnt = INT_MAX;
+ a->fr_cnt = INT_MAX;
}
}
static void reconf_timeout_cb(struct uloop_timeout *event)
{
- struct dhcp_assignment *a = container_of(event, struct dhcp_assignment, reconf_timer);
+ struct dhcp_assignment *a = container_of(event, struct dhcp_assignment, fr_timer);
- if (a->reconf_cnt > 0 && a->reconf_cnt < DHCPV6_REC_MAX_RC) {
+ if (a->fr_cnt > 0 && a->fr_cnt < DHCPV6_REC_MAX_RC) {
send_reconf(a);
- uloop_timeout_set(&a->reconf_timer,
- DHCPV6_REC_TIMEOUT << a->reconf_cnt);
- a->reconf_cnt++;
+ uloop_timeout_set(&a->fr_timer,
+ DHCPV6_REC_TIMEOUT << a->fr_cnt);
+ a->fr_cnt++;
} else
stop_reconf(a);
}
static void start_reconf(struct dhcp_assignment *a)
{
- uloop_timeout_set(&a->reconf_timer,
- DHCPV6_REC_TIMEOUT << a->reconf_cnt);
- a->reconf_timer.cb = reconf_timeout_cb;
- a->reconf_cnt++;
+ uloop_timeout_set(&a->fr_timer,
+ DHCPV6_REC_TIMEOUT << a->fr_cnt);
+ a->fr_timer.cb = reconf_timeout_cb;
+ a->fr_cnt++;
send_reconf(a);
}
static void stop_reconf(struct dhcp_assignment *a)
{
- uloop_timeout_cancel(&a->reconf_timer);
- a->reconf_cnt = 0;
- a->reconf_timer.cb = NULL;
+ uloop_timeout_cancel(&a->fr_timer);
+ a->fr_cnt = 0;
+ a->fr_timer.cb = NULL;
}
static void valid_until_cb(struct uloop_timeout *event)
a->flags |= OAF_BROKEN_HOSTNAME;
}
}
- a->accept_reconf = accept_reconf;
+ a->accept_fr_nonce = accept_reconf;
a->flags &= ~OAF_TENTATIVE;
a->flags |= OAF_BOUND;
apply_lease(a, true);
time_t valid_until;
time_t preferred_until;
-#define fr_timer reconf_timer
- struct uloop_timeout reconf_timer;
-#define accept_fr_nonce accept_reconf
- bool accept_reconf;
-#define fr_cnt reconf_cnt
- int reconf_cnt;
+ // ForceRenew - RFC6704 §3.1.2 (IPv4), RFC8415 (IPv6), §20.4, §21.11
+ struct uloop_timeout fr_timer;
+ bool accept_fr_nonce;
+ int fr_cnt;
uint8_t key[16];
struct odhcpd_ref_ip *fr_ip;
uint8_t *reqopts;
size_t reqopts_len;
-#define hwaddr mac
- uint8_t mac[6];
+ uint8_t hwaddr[6];
uint16_t clid_len;
uint8_t clid_data[];
blobmsg_add_u32(&b, "iaid", ntohl(a->iaid));
blobmsg_add_string(&b, "hostname", (a->hostname) ? a->hostname : "");
- blobmsg_add_u8(&b, "accept-reconf", a->accept_reconf);
+ blobmsg_add_u8(&b, "accept-reconf", a->accept_fr_nonce);
if (a->flags & OAF_DHCPV6_NA)
blobmsg_add_u64(&b, "assigned", a->assigned_host_id);
else