[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in CheckNetAssigned with Fix.

> Well.. look's like you opened a Pandora's Box on me!! ;-)
> The CheckNetAssigned function was totally braindead.  The original reason
> it was to find any blocks currently in the db that were smaller then a
> block.. example..
> DB:
> The original function when called with the block '' should
> return non-zero because exists (it actually returns the
> number of blocks that are their or zero).  This was to keep the Alloc
> and the 'Subnet' add functions from returning blocks that already had
> blocks in the db.
> Well.. turns out there was a CheckNetSmallerExist function that is
> to do this, so not only did was CheckNetAssigned broken,
> was also their and also broken.  To make things more confusing
> CheckNetSmallerExist was not even being used by anything!
> So... the fix.. i've removed CheckNetAssigned and fixed
> to work right.  The calls to CheckNetAssigned have been changed to
> CheckNetSmallerExist and all appears to be working a lot better..
> Phew.. this is too much for a Friday!! ;-)
> The fix is in CVS and I hope this nails it down.  Give it a run and see if
> this is the correct behaviour.

ROLF.. Okay... CheckNetAssigned was a function I had added in at some point
in one
of my patches which was suppose to have combined CheckNetSmallerExist and
because at one point.... Both functions were being called and I thought it
would be
more efficient to make a single query using a => in the query instead of a
two queries
using a > and a = in them.. Then.. I found this little bug... and fixed it..
:) I guess
at some point CheckNetSmallerExist was removed from functionallity and
replaced with
CheckNetAssigned. Hehehe.. What a mess.

Thanks, Billy