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>
When dhcpd.conf file got to be parsed such way that IP version could not
be determined the dhcpd.lease file parsing resulted to SIGSEGV.
Reported-by: Joey D. <jobewan@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Without this patch autoreconf, when done with release tarball, fails like
this:
$ autoreconf -f -i
sh: 1: build-aux/git-version-gen: not found
configure.ac:12: error: AC_INIT should be called with package and version arguments
/usr/share/aclocal-1.11/init.m4:26: AM_INIT_AUTOMAKE is expanded from...
configure.ac:12: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: /usr/bin/autom4te failed with exit status: 1
autoreconf: aclocal failed with exit status: 1
Further down the road tests start to fail after autoreconf.
make[4]: Leaving directory `/home/grohne/debian/dhcpd-pools-debian/tests'
make[3]: *** No rule to make target `../tests/test.sh', needed by `check-local'. Stop.
make[3]: Leaving directory `/home/grohne/debian/dhcpd-pools-debian/tests'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/home/grohne/debian/dhcpd-pools-debian/tests'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/grohne/debian/dhcpd-pools-debian'
Which is a symptom of not having test.sh in distribution.
Reported-by: Helmut Grohne <h.grohne@cygnusnetworks.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The problem is, that you simply count all lease occurrences in
dhcpd.leases, but only the last ones for each ip address are
valid. The lease file is more like a logfile of what has been
done, than a real database. To fix the counting issue, I'm using
a single hash (from uthash.h [1]) for the counting. This way
only the last lease entry for each IP gets into my counting
structure.
When you remove the duplicates in prepare_data(), you don't have
the information anymore, if the active lease entry or the free
lease entry came last. Simply deleting each ip from the touches
array, that is already in the leases array, gives you a big
chance to count wrong. Another way of fixing this would be to
not only store the ips in your arrays, but a structure containing
the ip and a global lease entry counter. Then you could delete
all entries except for the latest.
[1] http://uthash.sourceforge.net/
Reported-by: Huangy
Signed-off-by: Enno Gröper <groepeen@cms.hu-berlin.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
When { is wrote together with a word, such as
pool{
range 10.0.0.100 100.0.0.200;
range ..
the parser ignored first range, resulting it to disappear from analysis.
Reported-by: Robert Viou <robert.viou@ndsu.edu>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Version 2.16 needs the patche to compile correctly and without
warnings (tested on NetBSD, Mac OS X and Debian/Ubuntu).
Signed-off-by: Adam Ciarcinski <adam@netbsd.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>