Vincent Bernat [Wed, 18 Mar 2015 09:00:44 +0000 (10:00 +0100)]
priv: on Linux, when monitor dies, kill child
When the monitor dies, it sends its child a TERM signal but if it
segfaults or is killed with an uncatchable signal, the child will
continue to run "unharmed". On Linux, it is possible to send a signal to
the child in this case, with `prctl()`. Do that.
Vincent Bernat [Thu, 19 Feb 2015 15:52:55 +0000 (16:52 +0100)]
configure: move CFLAGS/CPPFLAGS to LLDP_CFLAGS/LLDP_CPPFLAGS
The goal is to avoid the user to override those flags when using `make
CFLAGS=somethingelse`. This is to enable a user to use `make
CFLAGS=-Werror` since this flag cannot be used with `./configure`.
Vincent Bernat [Fri, 13 Feb 2015 18:58:32 +0000 (19:58 +0100)]
interfaces: fallback to link local addresses for management
When no global address is found for a family, we fallback to a link
local address instead. For IPv4, this is 169.254.0.0/16 and for IPv6,
this is fe80::/64.
Vincent Bernat [Wed, 28 Jan 2015 13:50:12 +0000 (14:50 +0100)]
priv: rename "gethostbyname" priv function to "gethostname"
Because, it is not a wrapper around `gethostbyname()` but a way to get
local hostname. It currently uses `gethostbyname()` and therefore relies
on the presence of an IPv4 address in the system.
Vincent Bernat [Sun, 4 Jan 2015 17:13:23 +0000 (18:13 +0100)]
lldp: when MSAP changes, send a shutdown LLPDU
Chassis ID and port ID are not supposed to change. However, it is
possible for the port ID to change (for example, if the port name
changes or if the MAC addresses change). Since they should be constant,
we "fix" that by sending a shutdown LLPDU before any broadcasting any
change.
As a provision, this also applies to chassis ID even if it is currently
not possible for it to be changed.
Vincent Bernat [Mon, 15 Dec 2014 07:54:25 +0000 (08:54 +0100)]
man: `-I` option and the like also affect sending
Instead of using `listen` to describe the `-I` option, specify that it
also used to decide which interfaces LLDP will be enabled on, both for
listening and sending.
Vincent Bernat [Thu, 4 Dec 2014 00:02:29 +0000 (01:02 +0100)]
lldpd: decrease probability of collisions on port checksums
Instead of a 16-bit checksum, we use two 16-bit checkums, one for each
half of the serialized port. We now need more than 70000 ports to get a
50% chance of collision while we previously needed only 300 ports.
Vincent Bernat [Wed, 3 Dec 2014 21:05:34 +0000 (22:05 +0100)]
lldpd: fix timer initialization when checksum is 0
If the checksum computed over the port happens to be 0, the LLDPDU is
never scheduled for emission on this port. We ensure that a computed
checksum is never 0. If two different ports happen to have the same
checksum, we consider it unlikely enough to bear with the fact that the
timer will not be reset in this case.
Vincent Bernat [Tue, 4 Nov 2014 19:51:00 +0000 (20:51 +0100)]
lib: bump versioning
Even if the ABI stays the same, the ability to pass NULL is an interface
change (backward compatible). We don't want new versions of lldpcli to
interact with an old version of the library.
Vincent Bernat [Sun, 2 Nov 2014 15:25:21 +0000 (16:25 +0100)]
client: fix configuration modification
Handling of configuration change was messy. Whatever configuration item
needed to be updated, a whole lldpd_config structure was sent. The
daemon part was trying to guess what changed by assuming non-0 fields
need to be updated. However, when flags were added, the implementation
became inconsistent. Some flags used 1/2 for true/false, some others
kept 0/1. So, some flags were detected as changed while they were not.
Since we require to provide a current configuration before making any
change, we just copy the whole structure, modify what we want and send
it to the daemon. The daemon will then compare the new structure with
the old one to detect changes. Flags that were using 1/2 logic are now
just using 0/1 like others.
Vincent Bernat [Sun, 26 Oct 2014 10:31:34 +0000 (11:31 +0100)]
interfaces: bond listening was broken only for old kernels
With a recent kernel, we can listen to individual member. lldpd is still
listening on master to keep compatibility with older kernels and because
it is difficult to detect if the kernel gives us this ability or not. We
can't rely on version numbers as some kernels have backported
features (like 2.6.18 from RHEL 5).
Vincent Bernat [Sun, 26 Oct 2014 09:54:57 +0000 (10:54 +0100)]
interfaces: fix initialization of hardware h_data for bonds
On discovery, the master index was not correctly initialized and
therefore, the information was not retrieved correctly and therefore
listening on bond devices was broken since 0.7.0 (netlink rewrite).
Vincent Bernat [Fri, 24 Oct 2014 23:07:42 +0000 (01:07 +0200)]
frame: mention the licensing issue with POKE/PEEK macros
They were taken from ladvd but were originally based on the ones from
libcdp (under the Net::CDP umbrella) which is LGPLv2 licensed. To avoid
any grey area, the original author, Michael Chapman, kindly accepted to
relicense those under the ISC license.