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>
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>
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>
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>
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>
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>
Code blocks to more common first order. Also couple checks got to
be refactored next to section where update happens, that will
reduce unnecessary checking.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The xml output does not use output file as all other outputs, it
has sections here and there while everything is supposed to be in
output.c, and finally the unnecessary field analysis loop made
program about 20% slower when xml was not asked.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
ENOTTY, and clean_up will see that without this reset. At least
linux does this, and possibly some other systems. There's a
report from FreeBSD 8.0 which matches quite well with the
symptom.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The standard stuff that is needed in ignore files to make git
status etc commands not to freak out after a build.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The m4 has now .gitignore without content. That should work just
fine as a place holder director for automake.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Who ever will compile the sources is encouraged to use
./autogen.sh to get ./configure and other necessary files.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>