Vincent Bernat [Sun, 21 Feb 2016 14:04:38 +0000 (15:04 +0100)]
osx: ensure _lldpd user is hidden
We use /usr/bin/false. Otherwise, with OSX >= 10.8, having an UID < 500
is not sufficient. Another way would be to set `IsHidden` to TRUE but no
other users have this property.
Vincent Bernat [Sun, 21 Feb 2016 13:51:15 +0000 (14:51 +0100)]
osx: explain how to compile for older versions with recent SDK
It's still quite unclear how we could know which versions a given SDK
supports. Let's assume that we can support all still supported versions
with El Capitan.
David Morel [Wed, 10 Feb 2016 15:10:08 +0000 (16:10 +0100)]
netlink: fix reception of large netlink messages
If received netlink message is bigger than the buffer provided by the
application, netlink message flag will contain the MSG_TRUNC flag. In
this case it is up to the application to allocate a buffer large enough
to receive the full message and to call recv() again.
Vincent Bernat [Thu, 4 Feb 2016 19:25:59 +0000 (20:25 +0100)]
interfaces: fix alias handling
And try to add some simple tests for them. The manual page says that if
an alias is provided, the default is to use the alias as description and
port name as port ID. We try to respect that.
The tests are not as complete as they could be because the MSAP changes
due to the port ID change and this makes tests more complex.
Vincent Bernat [Thu, 4 Feb 2016 19:16:56 +0000 (20:16 +0100)]
netlink: merge old attributes with new ones
It seems that netlink won't advertise all attributes each time. At least
type can be not advertised in a netlink message. Copy the appropriate
attributes from the old ones when they are missing and we know they
can't change or be absent.
Vincent Bernat [Fri, 1 Jan 2016 20:11:02 +0000 (21:11 +0100)]
netlink: handle veth loops correctly
Since Linux 4.1, a pair of veth are referenced as IFLINK for each
other. We previously detected this loop easily and did break the loop by
removing this bogus information. However, when one of the interface is
updated, only the modified interface has IFLINK pointing to the other
interface. Therefore, no more loop but the information is incorrect. To
avoid that, don't reset indexes, just pointers. We only use indexes to
build correctly those pointers.
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