Vincent Bernat [Fri, 1 Jan 2016 07:54:32 +0000 (08:54 +0100)]
netlink: remove use of libnl3
Use netlink implementation from 0.7.19 instead but manage a cache
ourselves. The changes are quite minimal compared to the implementation
in 0.7.19. We handle deletion and updates. The use of linked list may be
problematic performance-wise.
When an interface goes down then up, no PDU is scheduled to be sent
again. This bug was already present in the previous implementation and
should be a regression of 36080c.
Vincent Bernat [Tue, 29 Dec 2015 08:53:08 +0000 (09:53 +0100)]
doc: no 0.8.0 release planned
The switch to libnl3 makes it difficult to do a proper release as the
compilation fails on many old platforms due to libnl3 requirement. The
plan is to reimplement a minimal version of libnl3 (same interface) for
our needs.
Vincent Bernat [Tue, 29 Dec 2015 08:41:40 +0000 (09:41 +0100)]
client: fix segfault when displaying some information
Due to 5ed4156c02b0ba801feb9bf383d9b7772dc990e5, we were incorrectly
hiding information when it was present and displaying it when it was
absent (leading to a segfault).
Vincent Bernat [Tue, 15 Dec 2015 08:46:29 +0000 (09:46 +0100)]
client: display numeric PCP
Since the string value for network policy priority can change depending
on the used standard, it seems better to also provide a numeric
value. We name it PCP.
Vincent Bernat [Sun, 13 Dec 2015 08:46:10 +0000 (09:46 +0100)]
build: don't enable PIE by default
PIE needs support from compiler, linker and dynamic linker. Even
when everything seems in place, it can be unreliable. On many ARM
toolchains, compiler and linker support is here but the dynamic
linker doesn't know how to handle that. It is also reported that
NetBSD/ppc or Solaris/x86 doesn't work correctly. Therefore, it is
too difficult to detect proper support at configure time (notably
with cross-compilation). Some OS (like OpenBSD, or Gentoo) come
with automatic PIE support. No need to do anyhing special for
them.
People wanting to enable PIE should now use --enable-pie.
Vincent Bernat [Sat, 12 Dec 2015 20:37:52 +0000 (21:37 +0100)]
build: use libbsd overlay
This enables more portable code. We check for the presence of libbsd and
use it if it is here. All the remaining should work with/without libbsd
on Linux or on other OSes.
Vincent Bernat [Tue, 1 Dec 2015 08:01:17 +0000 (09:01 +0100)]
interfaces: query permanent MAC address through ethtool
This is possible since 2.6.14. No need to parse a file. We still need to
do that as root as this is only allowed for mere mortals since
2.6.19 (and we would like to support 2.6.18). As a side note, it's
possible to query settings since 2.6.36 (so priv_ethtool is still
needed).
Vincent Bernat [Tue, 1 Dec 2015 07:15:04 +0000 (08:15 +0100)]
lldpmed: fix numeric values for L2 priority
"Best effort" is the default priority and is 0. Other priorities are
then ordered from 1 to 7 (from the lowest to the highest). Add a note in
the manual page about the fact that the labels are not enforceable and
more recent standards may change them and their meaning.
Vincent Bernat [Sat, 28 Nov 2015 13:49:45 +0000 (14:49 +0100)]
log: rework the way -d work
Now:
- `-d` means to stay in foreground, log to syslog
- `-dd` means to stay in foreground, log warnings to console
- `-ddd` means to stay in foreground, log warnings and info to console
- `-dddd` means to stay in foreground, log all to console
Vincent Bernat [Tue, 6 Oct 2015 05:55:46 +0000 (07:55 +0200)]
build: check runtime support of constructor/destructor
With some libc, we may have a compile-time support (through GCC), but
not a runtime support. For example, with uclibc, support for
constructors/destructors is optional. They can be enabled with
`CFLAGS=--uclibc-ctors` on some versions. On some others, they need to
be builtin by compiling uclibc with UCLIBC_CTOR_DTOR.
Unfortunately, cannot be tested when cross-compilation is in effect.
Vincent Bernat [Sat, 3 Oct 2015 23:50:38 +0000 (01:50 +0200)]
lldp: fix a buffer overflow when handling management address TLV
When a remote device was advertising a too large management address
while still respecting TLV boundaries, lldpd would crash due to a buffer
overflow. However, the buffer being a static one, this buffer overflow
is not exploitable if hardening was not disabled. This bug exists since
version 0.5.6.
Vincent Bernat [Wed, 16 Sep 2015 20:15:25 +0000 (22:15 +0200)]
build: fool autoreconf to do a recursive reconfiguration
We just redefine AC_CONFIG_SUBDIRS to our own empty version. autoreconf
will see this during the tracing step and will automatically reconfigure
libevent and libnl as well. This may unbreak people relying on tool
trying to regen configure without using the "autogen.sh" script.
Vincent Bernat [Sun, 23 Aug 2015 13:28:58 +0000 (15:28 +0200)]
lldpcli: fix per-port occurrences of "conf lldp"
Some commands were documented as not accepting a per-port setting while
they accepted it (without any effect). On the other hand, some other
commands were accepting and used per-port setting while not
documented. Fix all that.