The added test demonstrates the issue. If a did not end with whitespace
it was skipped.
Reported-by: Fredrik Lysén <fredrik.lysen@uadm.uu.se>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The problem with the detection of gcc's __builtin_expect, the autoconf
set up uses EX_COMPILE_IFELSE which only compiles the test code with gcc
-c, it does not link so a missing __builtin_expect is treated as a
missing symbol and is not detected.
Reported-by: Conor McCarthy <mr.spuratic@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Ranges that defined single IP and followed each other, for example
range 10.20.30.40 ;
range 10.20.30.41 ;
range 10.20.30.42 ;
were misinterpreted, and every second (the .41 in example) were skipped.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The code selection will be set with function pointer, which avoids
numerous IP version checks. As a result with some inputs the analysis
runs quicker. Most users will not notice much of difference.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
When it is known IPv4 is in use there is no need to spend time with if
statements checking whether IPv6 is in use.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The memccpy() is maintained in libc so there is no reason to reimplement
similar functionality within this software.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The POSIX_FADV_NOREUSE is more appropriate considering dhcpd-pools may
need cache, but not necessarily.
Reference: http://lwn.net/Articles/449420/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Some have configuration which combines small ranges such as one host, and
greater address ranges that are important to monitor. Especially the one
host ranges tend to cause a lot of false-positive alarms, as they are
immediately 100% full when a machine requests an address.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This will allow runnign dhcpd with cron, and when nothing is wrong emails
will not be sent.
Proposed-by: Dan Pritts <danno@umich.edu>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
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>
For reasons see excellent paper 'Recursive Make Considered Harmful' by
Peter Miller.
References: http://miller.emu.id.au/pmiller/books/rmch/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
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>