Vincent Bernat [Tue, 14 May 2013 07:23:21 +0000 (09:23 +0200)]
lib: keep space for new values in `lldpctl_key_t`
By inserting new values in the middle `lldpctl_key_t`, we break the
ABI of the library. To ensure future backward compatibility, we
introduce some space between each block. Unfortunately, this breaks
the current backward compatibility.
Vincent Bernat [Mon, 6 May 2013 19:31:42 +0000 (21:31 +0200)]
solaris: preliminary support
Basic functionalities are present. However, the interface support is
very poor. There is no way to detect bridges, VLAN and
aggregates. There is no MAC/PHY support. There is no detection of
wireless devices.
The code to detect IP forwarding is here but does not work inside the
chroot.
Vincent Bernat [Tue, 7 May 2013 20:05:01 +0000 (22:05 +0200)]
lib: use uint8_t instead of u_int8_t
`uint8_t` is part of C99 and comes from `stdint.h`. `u_int8_t` works
on many OS but not on some. There are many other occurrences but we
fix those here because this is the only public header.
Vincent Bernat [Fri, 3 May 2013 19:19:21 +0000 (21:19 +0200)]
netlink: fix IP address discovery
Since the switch to Netlink, the IP address was not advertised
correctly. Fix `netlink_send()`. Patch courtesy of Pradosh Mohapatra
from Cumulus Networks.
We can't request dh-autoreconf and have a buggy dh_installinit at the
same time. Let's remove this code about upstart. This only needs to be
fixed in backports.
Vincent Bernat [Sun, 31 Mar 2013 16:33:33 +0000 (18:33 +0200)]
lldpd: enforce TTL on remote chassis
Remote chassis were not expired in a timely manner. They were only
expired when a change happened on an interface. To fix this, we
maintain a timer that will be triggered when an interface is about to
expire. The timer is updated when a change happens and rescheduled
once it is run.
Vincent Bernat [Sun, 31 Mar 2013 10:59:09 +0000 (12:59 +0200)]
lldpd: limit the maximum of neighbors per port and per protocol
lldpd memory can be exhausted by adding too many neighbors. Moreover,
the communication with lldpcli is limited to a fixed number of
neighbors (packets may not exceed 1 << 19 in size). Therefore, we put
a hard limit to the number of neighbors accepted for a given port, for
a given protocol.
Vincent Bernat [Sat, 30 Mar 2013 14:42:51 +0000 (15:42 +0100)]
lib: fix sync_recv to handle segmentation
While it should not happen with Unix sockets, a read() can return only
partial data. Therefore, we continue to poll until we get the
appropriate length.
Vincent Bernat [Mon, 4 Feb 2013 07:38:08 +0000 (08:38 +0100)]
build: check if libevent as provided by pkg-config is working
If a user installs both libevent 2.0.x and libevent 1.4.x, pkg-config
may report libevent 2.0.x where it really is 1.4.x. The system is
broken in this case but we work-around this by using the shipped
libevent.
Vincent Bernat [Sun, 3 Feb 2013 08:38:19 +0000 (09:38 +0100)]
interfaces: whitelist an interface before being checking lower
Some whitelisted interfaces, like dsa, have a lower interface in
managed mode but we still want to advertise on it. Move the check for
lower interface after whitelisting.
Vincent Bernat [Tue, 29 Jan 2013 20:42:37 +0000 (21:42 +0100)]
libevent: produce smaller binaries when shipping libevent
When shipping libevent, we try to build smaller binaries by disabling
unneeded stuff (openssl, threading, malloc replacement, debug stuff)
and enabling `--gc-sections`. On various tests, this remove 80K from
lldpd size (stripping excluded).
Vincent Bernat [Sat, 19 Jan 2013 15:13:50 +0000 (16:13 +0100)]
lldpd: invoke lldpcli at start
To configure itself, lldpd now invokes lldpcli when
starting. Currently, it does not really check if everything works as
expected but in the future, lldpcli will ask lldpd to "start".
The configuration files are:
- ${sysconfdir}/lldpd.conf
- ${sysconfdir}/lldpd.d/*.conf
Vincent Bernat [Thu, 17 Jan 2013 21:01:34 +0000 (22:01 +0100)]
priv: add ability to lock filter on Linux
This is a new feature which should be available in Linux 3.9. See:
http://git.kernel.org/?p=linux/kernel/git/davem/net-next.git;a=commit;h=d59577b6ffd313d0ab3be39cb1ab47e29bdc9182
Vincent Bernat [Thu, 17 Jan 2013 08:02:48 +0000 (09:02 +0100)]
priv: create chroot if it does not exist
This is not the ideal situation since the chroot should maybe contain
some additional stuff (like `/etc/localtime` with GNU libc) to make it
work properly, but this is more convenient that leaving the user does
exactly the same things. Packagers are still expected to populate the
chroot correctly before starting lldpd.
Vincent Bernat [Mon, 14 Jan 2013 09:21:13 +0000 (10:21 +0100)]
priv: lock BPF interface on BSD
We move all BPF setup in the monitor process. When the socket is
configured, we lock it. This works for both OpenBSD and FreeBSD. This
feature does not seem to exist on Linux. However, for consistency, we
also move BPF filter setup in priv.c for Linux.
Vincent Bernat [Sun, 13 Jan 2013 12:15:52 +0000 (13:15 +0100)]
snmp: workaround unknown value for RONLY
This happens when Net-SNMP has been compiled with
NETSNMP_NO_LEGACY_DEFINITIONS defined. For example, on Mac OS X. This
seems a good way to deprecate an API still widely used just because it
is not used internally... <grin>
Vincent Bernat [Sun, 13 Jan 2013 01:53:37 +0000 (02:53 +0100)]
Small fixes detected by clang analyzer.
- log: mark `fatal*()` function as noreturn
- event: insert client in the list after its creation
- lldpcli: avoid confusion by initializing cargc to 0
- lldpd: avoid ambiguous use of strlen() in initialization
- lldp/edp: fix memory leaks
- tokenizer: fix a memory leak in low memory condition
- cdp: don't accept too short TLV for port description
Vincent Bernat [Sat, 12 Jan 2013 23:23:53 +0000 (00:23 +0100)]
build: more changelog drama
We need ChangeLog to be listed in `dist_doc_DATA` or
`doc_DATA`. Therefore, we list it in the former and if we happen to
install from git, we just ship an empty ChangeLog.
Vincent Bernat [Fri, 11 Jan 2013 00:25:32 +0000 (01:25 +0100)]
build: fix changelog generation
We really only want to generate changelog when building the dist
tarball. We force its generation using a fake PHONY target. We don't
list it as a dist_* something since it does not exist yet. Therefore,
we don't have to clean it.
Vincent Bernat [Thu, 10 Jan 2013 19:23:57 +0000 (20:23 +0100)]
Mac OS X support.
This includes bond, VLAN and bridge support. Mac OS X is pretty
similar to FreeBSD except for bonding which is different. Bonding code
is stolen from ifconfig.c. Header files from XNU are
shipped because they are missing from Mac OS X developer tools.
Still missing:
- integration into launchd
- homebrew formula
- DMI part (through ioreg)