<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7653.38">
<TITLE>mdb.c possible bug with leases reserved and in free/backup states</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>

<P><FONT SIZE=2>Hey Everyone,<BR>
<BR>
I posted this a few weeks ago<BR>
<BR>
<A HREF="http://marc.info/?l=dhcp-users&m=121995656726877&w=2">http://marc.info/?l=dhcp-users&m=121995656726877&w=2</A><BR>
<BR>
(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.<BR>
<BR>
Applying these changes to mdb.c I found it resolved my error messages of:<BR>
<BR>
"Lease with binding state free not on its queue"<BR>
"Lease with binding state backup not on its queue"<BR>
<BR>
which i received when setting leases to "reserved".<BR>
<BR>
1055,1058c1055,1061<BR>
<             case FTS_FREE:<BR>
<               lq = &comp -> pool -> free;<BR>
<               if (!(comp->flags & RESERVED_LEASE))<BR>
<                       comp->pool->free_leases--;<BR>
---<BR>
> case FTS_FREE:<BR>
> if (comp->flags & RESERVED_LEASE) {<BR>
> lq = &comp->pool->reserved;<BR>
> } else {<BR>
> lq = &comp->pool->free;<BR>
> comp->pool->free_leases++;<BR>
> }<BR>
1079,1082c1082,1088<BR>
<             case FTS_BACKUP:<BR>
<               lq = &comp -> pool -> backup;<BR>
<               if (!(comp->flags & RESERVED_LEASE))<BR>
<                       comp->pool->backup_leases--;<BR>
---<BR>
> case FTS_BACKUP:<BR>
> if (comp->flags & RESERVED_LEASE) {<BR>
> lq = &comp->pool->reserved;<BR>
> } else {<BR>
> lq = &comp->pool->backup;<BR>
> comp->pool->backup_leases++;<BR>
> }<BR>
<BR>
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.<BR>
<BR>
Thoughts?<BR>
<BR>
Nicola<BR>
</FONT>
</P>

</BODY>
</HTML>