The dhcpd.conf can contain single IP range definitions, such as
range 10.20.30.40;
and they must be understood similar way as the range definiton would have
two IP's that are the same IP, e.g.,
range 10.20.30.40 10.20.30.40;
Reported-by: Joey D. <jobewan@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The commit 805d353584 did not fix all
possible problem cases. This commit attempts to address remaining
issues.
Reported-by: Joey D. <jobewan@gmail.com>
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>
Helmut reported run of 'make check' failing in debian pbuilder
environment. The posix_fadvise() functions were failing with a message
such as
dhcpd-pools: parse_config: fadvise ../tests/confs/complete: Cannot allocate memory
which to me is likely error in how an error is determined. Relying on
errno value not being mangled by libc is unreliable. Attempt to fix this
is simple, check return values of these function calls and ignore the
errno.
Reported-by: Helmut Grohne <h.grohne@cygnusnetworks.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
When ./bootstrap has ran it tells to
- invoke gl_EARLY in ./configure.ac, right after AC_PROG_CC_C99,
Also AC_USE_SYSTEM_EXTENSIONS is needed to suppress spurious gnulib
warnings.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The commit b858a4778b changed a little bit
to which category various binding states fall into. That has to be
reflected in expected test results.
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>
[src/dhcpd-pools.c:68]: (style) The scope of the variable 'c' can be reduced.
[src/getdata.c:210]: (style) The scope of the variable 'c' can be reduced.
[src/hash.c:102]: (style) The scope of the variable 'l' can be reduced.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This will fix eight warnings similar to the example below.
sort.c:104:5: warning: no previous declaration for 'comp_ip' [-Wmissing-declarations]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The docs directory needs to be handled properly, e.g., create Makefile
which nothing, when doxygen is not enabled.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The prof. Xing Li in Tsinghua University, with LI Zimu, asked Cheer to
make the dhcpd-pools more usable for them which I, as a project
maintainer, could not be more pleased. Whils making the IPv6 analysis to
work Cheer also fixed various other issues. Kudos to him, and big thanks
to everyone.
CC: Xing Li <xing@cernet.edu.cn>
CC: LI Zimu <lzm@cernet.edu.cn>
CC: Cheer Xiao <xiaqqaix@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
dhcpd-pools.h:79:17: warning: comma at end of enumerator list [-pedantic]
hash.c:85 delete_lease() info: redundant null check on lease->ethernet calling free()
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The program counts quotes, which is never true/false value, and one of
the symbolic parse state values was missed in bd5ee58.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
No other function than mergesort_ranges() can use the merge(), so calling
it with rather generic name and making it static seems right to me.
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>
Gilles reported the full-json is currently broken, which the new check
demonstrates. Luckily the issue occurs only when active leases details
are being queried, leaving the count to be correct. That said bug is a
bug, and that should be corrected.
Reported-by: Gilles Bouthenot <gilles.bouthenot@univ-fcomte.fr>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>