[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..
> The original function when called with the block '192.168.1.0/24' should
> return non-zero because 192.168.1.128/25 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
of my patches which was suppose to have combined CheckNetSmallerExist and
because at one point.... Both functions were being called and I thought it
more efficient to make a single query using a => in the query instead of a
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
CheckNetAssigned. Hehehe.. What a mess.