[src/getdata.c:307]: (warning) Comparison of a boolean with integer that is neither 1 nor 0
[src/getdata.c:324]: (warning) Comparison of a boolean with integer that is neither 1 nor 0
[src/getdata.c:340]: (warning) Comparison of a boolean with integer that is neither 1 nor 0
[src/getdata.c:362]: (warning) Comparison of a boolean with integer that is neither 1 nor 0
[src/getdata.c:366]: (warning) Comparison of a boolean with integer that is neither 1 nor 0
[src/getdata.c:371]: (warning) Comparison of a boolean with integer that is neither 1 nor 0
[src/getdata.c:372]: (warning) Comparison of a boolean with integer that is neither 1 nor 0
[src/getdata.c:385]: (warning) Comparison of a boolean with integer that is neither 1 nor 0
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>
The script is not maintained, but perhaps nice to have a
reference how the IP sorting & range matching was done in demo
version. Actually more proper version number would have been 0.x
but it was not.
Signed-off-by: Sami Kerola <sami.kerola@tomtom.com>
This patch adds consistant underlining to arguments, and unifies
spacing. Also the wording for -L is made much better, it's been
common to hear the manual was unclear about that option.
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>
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>
other.c:77:7: warning: ISO C90 does not support the 'z' gnu_printf length modifier [-Wformat]
other.c:169:2: warning: string length '1046' is greater than the length '509' ISO C90 compilers are required to support [-Woverlength-strings]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The strstr is changed to xstrstr, which short cuts to points in
string where first differences are expected to found. This made
the tool tiny bit quicker.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The commit 1e82461875 was
incomplete, and at the end was a cause of off by one miscount.
The reason was bsearch where long int needed to be unsigned.
Weird that the original had work while there where so many type
mismatches.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Command version number in manual page output prone to be forgot
at the release time, so it is best to remove it completely.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Add recent changes to autotools header, function and compiler
capability checks. The patch also adds to .gitignore autoscan
outputs.
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>
My stupid mistake to leave statement hanging around while I where
wondering where the uninitialized memory came from.
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>
Ahmed reported he saw the following error with version 2.15 which
is an indication of unusual high number of clients that has been
seen. I am not sure where that happen, but I suspect an airport
or some other 'lots of mobiles getting leases' might be able to
case same situation.
dhcpd-pools: getdata.c:136: parse_leases: Assertion `!(touchesmallocsize < num_touches)' failed.
The problem was quite easy to fix simply getting rid of assert
and putting realloc in place.
Reported-by: Ahmed AL Dakhil <a.aldakhil@go.com.sa>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The lack of initialization may have cause unexpected outputs to
some users some times. That sort of behavior is also known by
name a bug.
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 help screen has now same notation as most of the GNU/Linux
utilities, e.g. if a option requires argument it is marked as
option=ARG. That enabled me to use help2man to make small nroff
fixes to manual page to unify it's outlook as well.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This patch is a step a head to make data all structures
completely dynamic. After this the next obvious thing to do is to
make shared networks struct a linked list instead of a list.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This is a test fix after commit
5cbe8d07fb
to see what can be done. Truth is that not much. I could fix how
ranges are allocated, but the fact there is pointers to shared
networks and network names reallocating the memory spaces is not
really going to work. The only way to truly fix this issue is to
create better data structures. As you can expect that is a major
change, and will take some time to implement.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
It seems that at least FreeBSD is setting errno when malloc is
successful. There is a change that other operating systems will
do similar things with same, or other system calls, and this will
invalidate the idea of checking errno at exit.
See also email list thread for further information.
http://lists.freebsd.org/pipermail/freebsd-questions/2011-April/229150.html
Reported-by: Roar Pettersen <rope1968@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Anders & Thor Eivind reported dhcpd-pools to mess console and
crash at the end of execution. Reason was missing boundary check.
The fix this time is more of less just a increase to max numbers.
That will work ot some extent.
The memory allocations has to be made fully dynamic, but that is
a little bit difficult with the way default.h and parse_config
are working. Basically problem is globals gone crazy & re-entrant
issue with parse function. The true fix to the issue will have to
wait for complete redesign of internals of the command.
Reported-by: Anders Lstad <ala@nextgentel.com>
Reported-by: Thor Eivind Brantzeg <tbr@nextgentel.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The tag v2.14 was probably done without -a option so it was not
recogniced by git describe. To over come this I found easiest to add
--tag to git-version-gen. This change should be reverted after a
release.
Signed-off-by: Sami Kerola <sami.kerola@tomtom.com>
The program_invocation_short_name portability code is copied
from util-linux project almost as is.
Reported-by: Roar Pettersen <rope1968@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>