From: David Hankins Date: Fri, 30 Jan 2009 22:31:22 +0000 (+0000) Subject: - Using reserved leases no longer results in 'lease with binding state X-Git-Tag: v4_2_0a1~100 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=26e59ee99b24816d9251d55a18f879714443b649;p=thirdparty%2Fdhcp.git - 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. [ISC-Bugs #19274] --- diff --git a/RELNOTES b/RELNOTES index e4c4b21bf..68f42c096 100644 --- 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 diff --git a/server/mdb.c b/server/mdb.c index 42b3abc6c..004e94ad3 100644 --- a/server/mdb.c +++ b/server/mdb.c @@ -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;