mdb.c possible bug with leases reserved and in free/backup states

Foggi, Nicola NFOGGI at
Wed Nov 5 22:19:33 UTC 2008

Hey Everyone,

I posted this a few weeks ago

(didn't hear anything back) but see the same code is in the new 3.1.2b1 so maybe i'm off base here, but this definitely fixed stability problems of setting a lease of "reserved" when running a pair of servers under 3.1.1.

Applying these changes to mdb.c I found it resolved my error messages of:

"Lease with binding state free not on its queue"
"Lease with binding state backup not on its queue"

which i received when setting leases to "reserved".

<             case FTS_FREE:
<               lq = &comp -> pool -> free;
<               if (!(comp->flags & RESERVED_LEASE))
<                       comp->pool->free_leases--;
> case FTS_FREE:
> if (comp->flags & RESERVED_LEASE) {
> lq = &comp->pool->reserved;
> } else {
> lq = &comp->pool->free;
> comp->pool->free_leases++;
> }
<             case FTS_BACKUP:
<               lq = &comp -> pool -> backup;
<               if (!(comp->flags & RESERVED_LEASE))
<                       comp->pool->backup_leases--;
> case FTS_BACKUP:
> if (comp->flags & RESERVED_LEASE) {
> lq = &comp->pool->reserved;
> } else {
> lq = &comp->pool->backup;
> comp->pool->backup_leases++;
> }

looking at it closer i just noticed i utilized ++ instead of -- as I had copied the same case statements from line 2118 and didn't catch the difference.  I see in 3.1.2b1 it's still the old method, and in my limited tests still caused the error messages i listed above.  I am no coder, so not sure if this is even kosher, but it seemed to resolve my problems.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the dhcp-users mailing list