1 diff -up dhcp-4.2.0/client/dhc6.c.honor-expired dhcp-4.2.0/client/dhc6.c
2 --- dhcp-4.2.0/client/dhc6.c.honor-expired 2010-10-07 12:55:37.000000000 +0200
3 +++ dhcp-4.2.0/client/dhc6.c 2010-10-07 12:56:43.000000000 +0200
4 @@ -1405,6 +1405,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 @@ -1417,8 +1446,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);