diff options
author | Thomas Markwalder <tmark@isc.org> | 2014-12-10 14:54:46 -0500 |
---|---|---|
committer | Thomas Markwalder <tmark@isc.org> | 2014-12-10 14:54:46 -0500 |
commit | 2775bd6212daf007f622592521cb938247c33b8d (patch) | |
tree | ec407ea35c08e7ebe27039d5d53346929eafccb7 /server | |
parent | 7116a34fc9b1fb307bcdca22e6963254289ecb80 (diff) | |
download | isc-dhcp-2775bd6212daf007f622592521cb938247c33b8d.tar.gz |
[master] Server will move FTS_BACKUP to FTS_FREE when pool has no peer
Merges in rt36960.
Diffstat (limited to 'server')
-rw-r--r-- | server/mdb.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/server/mdb.c b/server/mdb.c index e6cec3c5..cf9420a1 100644 --- a/server/mdb.c +++ b/server/mdb.c @@ -2621,6 +2621,22 @@ lease_instantiate(const void *key, unsigned len, void *object) lease->ip_addr.len, MDL); return ISC_R_SUCCESS; } + +#if defined (FAILOVER_PROTOCOL) + /* If the lease is in FTS_BACKUP but there is no peer, then the + * pool must have been formerly configured for failover and + * is now configured as standalone. This means we need to + * move the lease to FTS_FREE to make it available. */ + if ((lease->binding_state == FTS_BACKUP) && + (lease->pool->failover_peer == NULL)) { +#else + /* We aren't compiled for failover, so just move to FTS_FREE */ + if (lease->binding_state == FTS_BACKUP) { +#endif + lease->binding_state = FTS_FREE; + lease->next_binding_state = FTS_FREE; + lease->rewind_binding_state = FTS_FREE; + } /* Put the lease on the right queue. Failure to queue is probably * due to a bogus binding state. In such a case, we claim success, |