1 diff -up dhcp-4.3.0a1/client/dhc6.c.honor-expired dhcp-4.3.0a1/client/dhc6.c
2 --- dhcp-4.3.0a1/client/dhc6.c.honor-expired 2013-12-19 16:00:28.062183037 +0100
3 +++ dhcp-4.3.0a1/client/dhc6.c 2013-12-19 16:00:28.076182842 +0100
4 @@ -1351,6 +1351,32 @@ start_info_request6(struct client_state
8 +/* Run through the addresses in lease and return true if there's any unexpired.
9 + * Return false otherwise.
12 +unexpired_address_in_lease(struct dhc6_lease *lease)
15 + struct dhc6_addr *addr;
17 + for (ia = lease->bindings ; ia != NULL ; ia = ia->next) {
18 + for (addr = ia->addrs ; addr != NULL ; addr = addr->next) {
19 + if (addr->flags & DHC6_ADDR_EXPIRED)
22 + if (addr->starts + addr->max_life > cur_time) {
28 + log_info("PRC: Previous lease is devoid of active addresses."
29 + " Re-initializing.");
35 * start_confirm6() kicks off an "init-reboot" version of the process, at
36 * startup to find out if old bindings are 'fair' and at runtime whenever
37 @@ -1363,8 +1389,10 @@ start_confirm6(struct client_state *clie
39 /* If there is no active lease, there is nothing to check. */
40 if ((client->active_lease == NULL) ||
41 - !active_prefix(client) ||
42 - client->active_lease->released) {
43 + !active_prefix(client) ||
44 + client->active_lease->released ||
45 + !unexpired_address_in_lease(client->active_lease)) {
46 + dhc6_lease_destroy(&client->active_lease, MDL);