Ryan discovered a typo/issue while handling the man targets. This change
fixes the issue.
Reported-by: Ryan Steinmetz <zi@freebsd.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This can happen when there are no available shared networks. A division by
zero throws 'nan', which is non JSON-valid unless it's surrounded by double
quotes.
And it turns out mustach.c will not compile without config.h being
explicitly included before other headers, so let me do that.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The only thing the change does is the way the manpage gets parsed, and fixes
follwing warning.
"W: dhcpd-pools: groff-message an.tmac:<standard input>:147: warning: tbl
preprocessor failed, or it or soelim was not run; table(s) likely not
rendered (TE macro called with TW register undefined)
[usr/share/man/man1/dhcpd-pools.1.gz:1]"
Reference: https://www.mail-archive.com/debian-devel@lists.debian.org/msg377263.html
Signed-off-by: M. van Brummelen <mvb@debian.org>
Reviewed-by: Sami Kerola <kerolasa@iki.fi>
Not being able to open primary config file will cause fatal error, where as
include files will only warn. This is useful for setups that want to
publish some of the dhcp lease data, but not all. Such setup obviously
required dhcpd server to have differnt account than dhcpd-pools, with
carefully managed read permissions.
Requested-by: Björn Lässig <b.laessig@pengutronix.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Large quantity of data will be missing when snmptest.pl is used. The reason
is a sort in lexicographic order:
$ snmpwalk -v2c -c public localhost .1.3.6.1.4.1.2021.250.255 |head
iso.3.6.1.4.1.2021.250.255.2.1 = STRING: "10.4.52.1"
iso.3.6.1.4.1.2021.250.255.2.10 = STRING: "192.168.35.64"
iso.3.6.1.4.1.2021.250.255.2.100 = STRING: "192.168.196.1"
iso.3.6.1.4.1.2021.250.255.2.101 = STRING: "192.168.198.1"
iso.3.6.1.4.1.2021.250.255.2.102 = STRING: "192.168.209.225"
iso.3.6.1.4.1.2021.250.255.2.103 = STRING: "192.168.209.241"
SNMPGetNext after "root.2.1" should give "root.2.2". Thus, lots of
variables are missing.
The function is now dependant on a CPAN module NetSNMP::OID, (debian/ubuntu
package is called libsnmp-perl). This is probably not the most efficient
way to do it: walking the whole tree will be much slower.
Signed-off-by: Jean Benoit <jean@unistra.fr>
The crit/warn_count is tested against used rather than free. It is only for
shared networks, the range correctly subtracts count from size to get its
free.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Add padding where needed and order structure when it makes alignment fall
naturally to better order, with a single padding at the end of structure.
Reference: http://www.catb.org/esr/structure-packing/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
It is better to use library function to create date-time string than sprintf
various struct tm members. In same go retire time() call that is obsoleted
by clock_gettime().
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
These few lines has been part of code without any point in releases 2.17 to
3.0 and six and half years. Oops.
Reference: ae7747db87
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
In unlikely event of NaN being compared avoid exception. If NaN appears in
input data it will be evaluated as equal with any value.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
src/other.c:387:3: warning: switch missing default case [-Wswitch-default]
The one in do_counting() should be unreachable, so add abort() call to it.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
src/output.c:731:38: warning: implicit conversion from ‘float’ to ‘double’
when passing argument to function [-Wdouble-promotion]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>