[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
for
> it was to find any blocks currently in the db that were smaller then a
given
> block.. example..
>
> DB:
>
> 192.168.0.0/19
>  192.168.0.0/24
>  192.168.1.128/25
>  192.168.2.128/25
>
> The original function when called with the block '192.168.1.0/24' should
have
> 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
Wizard
> and the 'Subnet' add functions from returning blocks that already had
smaller
> blocks in the db.
>
> Well.. turns out there was a CheckNetSmallerExist function that is
supposed
> to do this, so not only did was CheckNetAssigned broken,
CheckNetSmallerExist
> 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
CheckNetSmallerExist
> 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
CheckNetExist
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