The earlier behavior made alarming nearly impossible to use for shared
networks only, as they often are expected to be whole lot less full than
ranges. Unfortunately if a alarm level was exceeded either by range or
shared network the exit value changed. In most of the cases that lead
alarms to be sent, without sensible message.
Reported-by: Dan Pritts <danno@umich.edu>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Some systems, such as freebsd, does not have program_invocation_short_name
available. There are also problems finding AF_INET{,6} definitions.
CC: Peter Fraser <p_fraser@hotmail.com>
Reported-by: Ryan Steinmetz <zi@freebsd.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The backup count was not printed at all. This bug was introduced in
version 2.17 (May 2012) when the uthash was taken in use.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
When ./configure --enable-doxygen is used one can browse internal api
documentation from docs/html directory.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Real dhcpd.leases file should always have ethernet address markup, but
test data or malformed files might not have. Even if the check is 99.99%
useless there are the corner cases, and crashing at them is not good.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Earlier ethernet address collection did not remove duplicated. Basically
the problem was the same as in problem fixed in commit
ae7747db87, but this time affecting only
the ethernet addresses. The fix is, as one can see, to make ethernet
collection to share structure with the lease, so that if one is wrong
both are wrong the same way.
Reported-by: Gilles Bouthenot <gilles.bouthenot@univ-fcomte.fr>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
And remove extra empty lines where they are not needed.
Reviewed-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Gilles Bouthenot <gilles.bouthenot@univ-fcomte.fr>
The DHCP version is determined according to the first IP address that
appears in the configuration file. Caveat; counters are of native long
type. Since IPv6 address space has 2^128 addresses, they are subject to
overflow.
[Sami Kerola: This commit also fixed a percent sorting bug, which has
been broken always. See changes ret_percent() for the fix.]
CC: LI Zimu <lzm@cernet.edu.cn>
CC: Xing Li <xing@cernet.edu.cn>
Reviewed-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Cheer Xiao <xiaqqaix@gmail.com>
There were too clever tricks done with first and last. Earlier the aim
was to minimize '<=' and '>=' by fiddling with the numbers at the time
when they were saved. While the program logic seemed to work there were
some off by one mistakes, resulting to a count error. Even worse there
is not even that many of such comparisons, so that one cannot really even
justify added complexity. I really hope this patch is last this kind fix
ever needed.
Reported-by: Cheer Xiao <xiaqqaix@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This will mean better portability, and a good reason to get rid of
various portability autotools directives which where part of this
project.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
output.c:819:17: warning: comparison of integers of different signs:
'int' and ' unsigned int' [-Wsign-compare]
for (i = 0; i < num_ranges; i++) {
~ ^ ~~~~~~~~~~
output.c:832:17: warning: comparison of integers of different signs:
'int' and ' unsigned int' [-Wsign-compare]
for (i = 0; i < num_shared_networks; i++) {
~ ^ ~~~~~~~~~~~~~~~~~~~
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The full html will now print the mtime of dhcpd.leases file in
header. Additionally at the footer of the page the dhcpd-pools
will have package name and version number.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Remove unnecessary type casting, move .gitignore file contents to
right location, reindent to use Linux coding style, fix few type
mismatches, clean up to help & version output and hint compiler
call to these functions will end program.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
After uint32_t fix from 1e82461875
it was good idea to check which headers where needed where. And
generally clean up the includes while doing the check.
There where long and unsigned long used for IPs in use which
caused occasional off by one errors. The word occasional should
be read: pretty much every one with large enough configuration
has been affected.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Usage of includes are set up the way found to be in use, with a help of
magnificent utility.
http://code.google.com/p/include-what-you-use/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The eprintf removed and replaced with err & warn. Option parsing
no longer tries to find missing optargs, which are getopts should
notice. Few complier warnings got to be removed as well. Finally
the commments will no longer exceed standard terminal width.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>