]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- Using reserved leases no longer results in 'lease with binding state
authorDavid Hankins <dhankins@isc.org>
Fri, 30 Jan 2009 22:31:22 +0000 (22:31 +0000)
committerDavid Hankins <dhankins@isc.org>
Fri, 30 Jan 2009 22:31:22 +0000 (22:31 +0000)
  free not on its queue' error messages, thanks to a patch from Frode
  Nordahl. [ISC-Bugs #19274]

RELNOTES
server/mdb.c

index e4c4b21bfdf583873277a73bdcba6064771c380b..68f42c09664416e54190c9a9faa2c52c988c6485 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -63,6 +63,10 @@ work on other platforms. Please report any problems and suggested fixes to
 
 - The db-time-format option was documented in manpages.
 
+- Using reserved leases no longer results in 'lease with binding state
+  free not on its queue' error messages, thanks to a patch from Frode
+  Nordahl.
+
                        Changes since 4.1.0b1
 
 - A missing "else" in dhcrelay.c could have caused an interface not to
index 42b3abc6c9efd1c517b2c792dba7e05beee90a05..004e94ad3dc036fe0578df3e1e7ea2ab2645c3c7 100644 (file)
@@ -1236,9 +1236,12 @@ int supersede_lease (comp, lease, commit, propogate, pimmediate)
        /* Figure out which queue it's on. */
        switch (comp -> binding_state) {
              case FTS_FREE:
-               lq = &comp -> pool -> free;
-               if (!(comp->flags & RESERVED_LEASE))
+               if (comp->flags & RESERVED_LEASE)
+                       lq = &comp->pool->reserved;
+               else {
+                       lq = &comp->pool->free;
                        comp->pool->free_leases--;
+               }
 
 #if defined(FAILOVER_PROTOCOL)
                do_pool_check = 1;
@@ -1260,9 +1263,12 @@ int supersede_lease (comp, lease, commit, propogate, pimmediate)
                break;
 
              case FTS_BACKUP:
-               lq = &comp -> pool -> backup;
-               if (!(comp->flags & RESERVED_LEASE))
+               if (comp->flags & RESERVED_LEASE)
+                       lq = &comp->pool->reserved;
+               else {
+                       lq = &comp->pool->backup;
                        comp->pool->backup_leases--;
+               }
 
 #if defined(FAILOVER_PROTOCOL)
                do_pool_check = 1;