Version 2.7

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2008-05-18 00:00:00 +02:00
parent 4f000e7ab6
commit 625cde6b9c
26 changed files with 13445 additions and 1465 deletions

View file

@ -34,7 +34,7 @@ prepare_data (void)
/* Sort leases */
qsort (leases, (size_t) num_leases, sizeof (long int), &intcomp);
/* Get rid of dublicates */
/* Get rid of lease dublicates */
for (k = j = i = 0; i < num_leases; i++)
{
if (j != leases[i])
@ -46,12 +46,12 @@ prepare_data (void)
}
num_leases = k;
/* Delete touched IPs that are in use */
/* Delete touched IPs that are in use. */
j = 0;
for (i = 0; i < num_touches; i++)
{
if (bsearch
(&touches[i], leases, num_leases, sizeof (long int),
(&touches[i], leases, (size_t) num_leases, sizeof (long int),
&intcomp) == NULL)
{
touches[j] = touches[i];
@ -77,10 +77,12 @@ do_counting (void)
i = j = 0;
range_p = ranges;
/* Walk through ranges */
for (k = 0; k < num_ranges; k++)
{
/* Count IPs in use */
for (; range_p->last_ip > leases[i] && i < num_leases; i++)
for (; range_p->last_ip > leases[i] && (unsigned long) i < num_leases;
i++)
{
if (range_p->first_ip > leases[i])
{
@ -94,9 +96,9 @@ do_counting (void)
}
}
/* Count touched IPs */
for (; range_p->last_ip > touches[j] && j < num_touches; j++)
for (; range_p->last_ip > touches[j] && (unsigned long) j < num_touches;
j++)
{
if (range_p->first_ip > touches[j])
{
@ -111,7 +113,7 @@ do_counting (void)
}
/* Size of range, shared net & all networks */
block_size = range_p->last_ip - range_p->first_ip - 1;
block_size = (unsigned int) (range_p->last_ip - range_p->first_ip - 1);
if (range_p->shared_net)
{
range_p->shared_net->available += block_size;