mdb.c possible bug with leases reserved and in free/backup states
Foggi, Nicola
NFOGGI at depaul.edu
Wed Nov 5 22:19:33 UTC 2008
Hey Everyone,
I posted this a few weeks ago
http://marc.info/?l=dhcp-users&m=121995656726877&w=2
(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".
1055,1058c1055,1061
< 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++;
> }
1079,1082c1082,1088
< 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.
Thoughts?
Nicola
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20081105/5f221620/attachment.html>
More information about the dhcp-users
mailing list