dhcp: fix dhcpv6 client and dhcpv6 prefix delegation

Keep trying even if the interface in question is not "admin-up,
link-up." In real life, it's normal for link autonegotiation to take a
good fraction of a second. The driver layer takes care of packets sent
to an interface which can't transmit at the moment.

Renew address leases at the preferred renewal time, not at the
expiration time.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I68ec1c52cc1f4a8aa256185820748b845e92f7c1
This commit is contained in:
Dave Barach
2019-11-08 20:20:17 -05:00
committed by Florin Coras
parent 3c80c106a8
commit 20b962d3e4
3 changed files with 19 additions and 37 deletions
+10 -2
View File
@@ -302,7 +302,11 @@ dhcp6_reply_event_handler (vl_api_dhcp6_reply_event_t * mp)
{
address_info->preferred_lt = preferred_time;
address_info->valid_lt = valid_time;
address_info->due_time = current_time + valid_time;
address_info->due_time = current_time;
/* Renew the lease at the preferred time, if non-zero */
address_info->due_time += (preferred_time > 0) ?
preferred_time : valid_time;
if (address_info->due_time > rm->max_valid_due_time)
rm->max_valid_due_time = address_info->due_time;
continue;
@@ -316,7 +320,11 @@ dhcp6_reply_event_handler (vl_api_dhcp6_reply_event_t * mp)
address_info->address = *address;
address_info->preferred_lt = preferred_time;
address_info->valid_lt = valid_time;
address_info->due_time = current_time + valid_time;
address_info->due_time = current_time;
/* Renew the lease at the preferred time, if non-zero */
address_info->due_time += (preferred_time > 0) ?
preferred_time : valid_time;
if (address_info->due_time > rm->max_valid_due_time)
rm->max_valid_due_time = address_info->due_time;
rm->client_state_by_sw_if_index[sw_if_index].address_count++;