]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[master] Server will move FTS_BACKUP to FTS_FREE when pool has no peer
authorThomas Markwalder <tmark@isc.org>
Wed, 10 Dec 2014 19:54:46 +0000 (14:54 -0500)
committerThomas Markwalder <tmark@isc.org>
Wed, 10 Dec 2014 19:54:46 +0000 (14:54 -0500)
    Merges in rt36960.

RELNOTES
server/mdb.c

index 4a4b9fb4407a3570b3cffcc251f491737b43cc2c..421318ace1b2f38f48ed9a613d8dd7b4781ee5f2 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -179,6 +179,15 @@ by Eric Young (eay@cryptsoft.com).
   The functionality is now only available through the new runtime paramater.
   [ISC-Bugs #37551]
 
+- During startup, when the server encounters a lease whose binding state is
+  FTS_BACKUP but whose pool has no configured failover peer, it will reset the
+  lease's binding state to FTS_FREE.  This allows the leases to be reclaimed
+  by the server after a pool's configuration has changed from failover to
+  standalone. Prior to this such leases would remain stuck in the backup state
+  making them unavailable for assignment.  Note this conversion will occur
+  whether or not the server is compiled for failover.
+  [ISC-Bugs #36960]
+
                        Changes since 4.3.1b1
 
 - Modify the linux and openwrt dhclient scripts to process information
index e6cec3c5c9bc5df95847bffdcb6ea5e9f4b80f8f..cf9420a147d09ea4c6cf0524d837fe18c55dafc9 100644 (file)
@@ -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,