iface->ra = MODE_DISABLED;
iface->ndp = MODE_DISABLED;
iface->learn_routes = 1;
- iface->dhcpv4_leasetime = 43200;
+ iface->dhcp_leasetime = 43200;
iface->dhcpv4_start.s_addr = htonl(START_DEFAULT);
iface->dhcpv4_end.s_addr = htonl(START_DEFAULT + LIMIT_DEFAULT - 1);
iface->dhcpv6_assignall = true;
if (time < 0)
goto err;
- iface->dhcpv4_leasetime = time;
+ iface->dhcp_leasetime = time;
}
if ((c = tb[IFACE_ATTR_START])) {
if (a->leasetime)
my_leasetime = a->leasetime;
else
- my_leasetime = iface->dhcpv4_leasetime;
+ my_leasetime = iface->dhcp_leasetime;
if ((*leasetime == 0) || (my_leasetime < *leasetime))
*leasetime = my_leasetime;
if (a->leasetime)
leasetime = a->leasetime;
else
- leasetime = iface->dhcpv4_leasetime;
+ leasetime = iface->dhcp_leasetime;
uint32_t pref = leasetime;
uint32_t valid = leasetime;
if (prefix_pref != UINT32_MAX)
prefix_pref -= now;
+ if (prefix_pref > leasetime)
+ prefix_pref = leasetime;
+
if (prefix_valid != UINT32_MAX)
prefix_valid -= now;
+ if (prefix_valid > leasetime)
+ prefix_valid = leasetime;
+
if (a->flags & OAF_DHCPV6_PD) {
struct dhcpv6_ia_prefix o_ia_p = {
.type = htons(DHCPV6_OPT_IA_PREFIX),
uint32_t ra_hoplimit;
int ra_mtu;
+ // DHCP
+ uint32_t dhcp_leasetime;
+
// DHCPv4
struct in_addr dhcpv4_start;
struct in_addr dhcpv4_end;
size_t dhcpv4_router_cnt;
struct in_addr *dhcpv4_dns;
size_t dhcpv4_dns_cnt;
- uint32_t dhcpv4_leasetime;
bool dhcpv4_forcereconf;
// DNS
preferred = TIME_LEFT(addr->preferred, now);
if (iface->ra_useleasetime &&
- preferred > iface->dhcpv4_leasetime)
- preferred = iface->dhcpv4_leasetime;
+ preferred > iface->dhcp_leasetime)
+ preferred = iface->dhcp_leasetime;
}
valid = TIME_LEFT(addr->valid, now);
- if (iface->ra_useleasetime && valid > iface->dhcpv4_leasetime)
- valid = iface->dhcpv4_leasetime;
+ if (iface->ra_useleasetime && valid > iface->dhcp_leasetime)
+ valid = iface->dhcp_leasetime;
if (minvalid > valid)
minvalid = valid;