Commit graph

66 commits

Author SHA1 Message Date
Sami Kerola
8c6a3d9a4a build-sys: ignore gprof & gcov files
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-10 22:01:57 +02:00
Sami Kerola
f9eb53a215 bug: use uint32_t for IP numbers
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>
2011-07-09 23:32:25 +02:00
Sami Kerola
f51f2e9fe1 licensing: set placeholder properly
I should have done this at commit a31fd0d97a

sed -i 's/<COPYRIGHT HOLDER>/THE AUTHOR AND CONTRIBUTORS/'

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-09 10:18:53 +02:00
Sami Kerola
648891d8bd docs: remove version from manual page
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>
2011-07-08 23:10:15 +02:00
Sami Kerola
1822439bfd docs: NEWS update
The update was not done at last release.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-08 23:07:05 +02:00
Sami Kerola
704e0fdd4a build-sys: autotools configure.ac update
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>
2011-07-08 22:58:38 +02:00
Sami Kerola
cef03de0a9 output: change to full html behaviour
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>
2011-07-08 22:33:13 +02:00
Sami Kerola
76915512b2 maint: coding style fixes
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>
2011-07-08 21:41:35 +02:00
Sami Kerola
68c2d7b8cc THANKS: add Ahmed AL Dakhil
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-08 20:04:17 +02:00
Sami Kerola
d29fd809c9 analyze: debugging leftover removed
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>
2011-07-08 18:05:20 +02:00
Sami Kerola
26db4eafdc all: include-what-you-see fixes
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.
2011-07-08 18:02:36 +02:00
Sami Kerola
d02b684133 getdata: initialize memory
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-08 17:34:39 +02:00
Sami Kerola
12271887db analyze: use more logical variable names
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-08 17:03:12 +02:00
Sami Kerola
1e82461875 bug: use uint32_t for IP numbers
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>
2011-07-08 16:28:22 +02:00
Sami Kerola
3c1d033a79 getdata: potential overflow due unit change
The commit c28488cbe8 introduced
potential memory overflow due unintentional unit change.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-08 15:27:15 +02:00
Sami Kerola
c28488cbe8 getdata: realloc instead of asserting
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>
2011-07-08 14:36:47 +02:00
Sami Kerola
8d94580c3d parse_leases: exit at read error
Signed-off-by: Sami Kerola <sami.kerola@tomtom.com>
2011-06-23 15:59:06 +02:00
Sami Kerola
a31fd0d97a licensing: use FreeBSD license (was GNUv3)
This change will also remove getopt source code and headers,
which has GNU license that I cannot change.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-21 22:54:03 +02:00
Sami Kerola
dd5b77b62c prepare_memory bug: initialization missing
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>
2011-06-21 22:39:17 +02:00
Sami Kerola
55ab31e482 other: free backup ranges
Fix to memory leak I overlooked earlier.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-21 22:39:09 +02:00
Sami Kerola
e299e7fce2 headers: include-what-you-use fixes
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>
2011-06-08 20:59:56 +02:00
Sami Kerola
4c9f177b2e docs: add missing full-html flag
Missing both from help output & manual page.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-07 22:47:02 +02:00
Sami Kerola
2cb7369e20 docs: help screen & man page
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>
2011-06-07 22:02:57 +02:00
Sami Kerola
441431eae8 thanks: list update
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-12 19:43:59 +02:00
Sami Kerola
c81af2df45 shared network names to be dynamically allocated
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>
2011-04-11 20:52:40 +02:00
Sami Kerola
b492802dfa make range allocation dynamic
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>
2011-04-10 19:12:29 +02:00
Sami Kerola
f6880ed5f4 clean_up: checking errno at exit does not make sense
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>
2011-04-09 17:38:54 +02:00
Sami Kerola
5cbe8d07fb getdata: increase max number of shared networks
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>
2011-04-05 21:10:46 +02:00
Sami Kerola
d75927df39 build-sys: git describe listed wrong tag
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>
2011-04-05 13:30:50 +02:00
Sami Kerola
66bfc0d5b2 build-sys: use git version as program version output
The functionality copied is from gnulib.

http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=build-aux/git-version-gen;h=686f7031a6037445bfcb7b43fb4da3c8240d8575;hb=HEAD

Signed-off-by: Sami Kerola <sami.kerola@tomtom.com>
2011-03-31 14:44:42 +02:00
Sami Kerola
d54721b3a4 dhcpd-pools.h: portable program_invocation_short_name
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>
2011-03-23 22:26:57 +01:00
Sami Kerola
a10396710e flose files & free memory when not needed
Fixes to issues found with valgrind.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-03-19 20:39:01 +01:00
Sami Kerola
b11163012e autotools: point correct location of src
Fix to error where program src is. Also a bit of clean up and
alignment with autoscan output.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-03-19 12:14:52 +01:00
Sami Kerola
faf892114d getdata.c: initialize variables to have safe values
Primarily to get rid of following warning.

getdata.c:63:26: warning: 'macstring' may be used uninitialized in this function
getdata.c:66:20: warning: 'macaddr_p' may be used uninitialized in this function

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-03-19 11:55:47 +01:00
Sami Kerola
e219f3f722 dhcpd-pools.h: indentation fix
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-03-19 11:52:30 +01:00
Sami Kerola
93bcd305c4 dhcpd-pools.h: function attributes declarations
Advice compiler about functions to generate better optimization
and argument checks.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-03-19 11:48:48 +01:00
Sami Kerola
8544983585 Release 2.14
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-03-07 22:26:32 +01:00
Sami Kerola
0f7beafd81 configure.ac: autoscan updates
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-02-13 13:24:06 +01:00
Sami Kerola
33e23c39c1 ignore INSTALL file
I forgot to put the INSTALL file to .gitignore at the time of
commit fdcfcd12d3

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-02-12 23:08:45 +01:00
Sami Kerola
ed2266424d fix to safe_strdup prototype.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-02-12 23:07:57 +01:00
Sami Kerola
fdcfcd12d3 INSTALL file is unnecessary
Also few typos got to be fixed.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-02-08 22:52:11 +01:00
Sami Kerola
171ff1d704 Allow xml output with leases to use output file
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-02-08 22:11:49 +01:00
Sami Kerola
17429ef85b Copyright notice change to GNU license 3
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-02-08 20:33:09 +01:00
Sami Kerola
ed56b238d5 autogen.sh: typo fix in previous commit
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-02-08 19:52:38 +01:00
Sami Kerola
7e38c27012 autogen.sh: test bug fix & clean up to messages
The test had == used as = which is bashisms, and does not work on
system, such as Ubuntu, where /bin/sh is dash or some other
non-bash shell.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-02-08 19:30:57 +01:00
Sami Kerola
9cc94f1b9f Do not analyze if sort field selector is rubbish.
Error message also had a bug, it's changed to be over all more
helpful.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-01-22 22:50:14 +01:00
Sami Kerola
10488b0a04 posix_fadvice advice parameter change
With a bit of manual rereading and thinking I came to conclusion
that users will most likely fetch same data over and over again.
Advicing to kernel to keep pages into cache seems to be correct
thing to do.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-01-22 22:05:53 +01:00
Sami Kerola
f32e023ecf Impossible to reach sections removed
With a bit of gcov analysis, and logical thinking, it was obvious
that section that got to be removed cannot be reach.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-01-22 21:54:38 +01:00
Sami Kerola
9169422e9b Not a syscall error, warn should be warnx.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-01-22 21:29:48 +01:00
Sami Kerola
849c8f5e73 Use what libc will provide
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>
2011-01-22 20:53:15 +01:00