mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-28 12:57:42 +00:00
[master] dhclient (-6) skips confirm (INIT REBOOT) is all leases are expired
Merges in rt22675.
This commit is contained in:
parent
fa6c4c081f
commit
f1fc5ede22
5
RELNOTES
5
RELNOTES
@ -313,6 +313,11 @@ dhcp-users@lists.isc.org.
|
|||||||
[ISC-Bugs #23252]
|
[ISC-Bugs #23252]
|
||||||
[ISC-Bugs #37221]
|
[ISC-Bugs #37221]
|
||||||
|
|
||||||
|
- Modified dhclient (-6) to bypass sending a confirm (INIT REBOOT) when it has
|
||||||
|
only expired address assocations. Thanks to Jiri Popelka at Red Hat for
|
||||||
|
raising the issue and submitting the patch.
|
||||||
|
[ISC-Bugs #22675]
|
||||||
|
|
||||||
Changes since 4.3.0 (bug fixes)
|
Changes since 4.3.0 (bug fixes)
|
||||||
|
|
||||||
- Tidy up several small tickets.
|
- Tidy up several small tickets.
|
||||||
|
@ -145,11 +145,11 @@ static isc_result_t dhc6_check_status(isc_result_t rval,
|
|||||||
unsigned *code);
|
unsigned *code);
|
||||||
static int dhc6_score_lease(struct client_state *client,
|
static int dhc6_score_lease(struct client_state *client,
|
||||||
struct dhc6_lease *lease);
|
struct dhc6_lease *lease);
|
||||||
|
|
||||||
static isc_result_t dhc6_add_ia_na_decline(struct client_state *client,
|
static isc_result_t dhc6_add_ia_na_decline(struct client_state *client,
|
||||||
struct data_string *packet,
|
struct data_string *packet,
|
||||||
struct dhc6_lease *lease);
|
struct dhc6_lease *lease);
|
||||||
static int drop_declined_addrs(struct dhc6_lease *lease);
|
static int drop_declined_addrs(struct dhc6_lease *lease);
|
||||||
|
static isc_boolean_t unexpired_address_in_lease(struct dhc6_lease *lease);
|
||||||
|
|
||||||
extern int onetry;
|
extern int onetry;
|
||||||
extern int stateless;
|
extern int stateless;
|
||||||
@ -1571,7 +1571,9 @@ start_confirm6(struct client_state *client)
|
|||||||
/* If there is no active lease, there is nothing to check. */
|
/* If there is no active lease, there is nothing to check. */
|
||||||
if ((client->active_lease == NULL) ||
|
if ((client->active_lease == NULL) ||
|
||||||
!active_prefix(client) ||
|
!active_prefix(client) ||
|
||||||
client->active_lease->released) {
|
client->active_lease->released ||
|
||||||
|
!unexpired_address_in_lease(client->active_lease)) {
|
||||||
|
dhc6_lease_destroy(&client->active_lease, MDL);
|
||||||
start_init6(client);
|
start_init6(client);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -6109,5 +6111,29 @@ int drop_declined_addrs(struct dhc6_lease *lease) {
|
|||||||
return (live_cnt);
|
return (live_cnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Run through the addresses in lease and return true if there's any unexpired.
|
||||||
|
* Return false otherwise.
|
||||||
|
*/
|
||||||
|
static isc_boolean_t
|
||||||
|
unexpired_address_in_lease(struct dhc6_lease *lease)
|
||||||
|
{
|
||||||
|
struct dhc6_ia *ia;
|
||||||
|
struct dhc6_addr *addr;
|
||||||
|
|
||||||
|
if (lease == NULL) {
|
||||||
|
return ISC_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (ia = lease->bindings ; ia != NULL ; ia = ia->next) {
|
||||||
|
for (addr = ia->addrs ; addr != NULL ; addr = addr->next) {
|
||||||
|
if (!(addr->flags & DHC6_ADDR_EXPIRED) &&
|
||||||
|
(addr->starts + addr->max_life > cur_time)) {
|
||||||
|
return ISC_TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
log_debug("PRC: Previous lease is devoid of active addresses.");
|
||||||
|
return ISC_FALSE;
|
||||||
|
}
|
||||||
#endif /* DHCPv6 */
|
#endif /* DHCPv6 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user