Vincent Bernat [Sun, 8 Apr 2018 17:26:43 +0000 (19:26 +0200)]
build: don't be picky about deprecated stuff in libevent
This should fix:
evutil_rand.c:177:2: error: 'arc4random_addrandom' is deprecated: first deprecated in macOS 10.12 - use arc4random_stir [-Werror,-Wdeprecated-declarations]
Vincent Bernat [Sat, 17 Mar 2018 15:28:31 +0000 (16:28 +0100)]
lldpd: add an option to keep some specified ports
A user can specify a pattern of ports to not delete even when they are
removed from the system. If a port is removed from the system and
match the pattern, it will be kept in memory.
Thomas Eliasson [Thu, 8 Mar 2018 14:34:17 +0000 (15:34 +0100)]
client: add alternative way to configure port description
The existing port description CLI command only allows user configured
description if setting port id subtype to local. This patch introduces
an subtype independent way to configure port description.
Signed-off-by: Jonas Johansson <jonas.johansson@westermo.se>
Thomas Eliasson [Thu, 8 Mar 2018 14:10:39 +0000 (15:10 +0100)]
handle lldpStatsRemTablesLastChangeTime correctly when items are removed
When a port is removed, the time has to be updated. The last removal time is
registered per local port, and this timestamp will be used as
lldpStatsRemTablesLastChangeTime if it is the latest timestamp.
Also, the lldpStatsRemTablesDeletes is always increased when an entry in the
table is deleted.
Signed-off-by: Jonas Johansson <jonas.johansson@westermo.se>
Vincent Bernat [Sun, 31 Dec 2017 11:57:52 +0000 (12:57 +0100)]
daemon: move vfork/fork handling directly in lldpd.c
This is not needed elsewhere. This way, we ensure redefinition of
vfork() to fork() through a define is working as expected, even when
some system headers may try to rename vfork too.
Damien Riegel [Mon, 18 Dec 2017 19:37:08 +0000 (14:37 -0500)]
configure: remove check on CXX compiler
lldpd fails to build if the toolchain doesn't have a C++ compiler
because configure fails with the following error:
checking how to run the C++ preprocessor... /lib/cpp
configure: error: in `/home/dkc/src/buildroot/build-zii/build/lldpd-0.9.4':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
Since "8d92800b: build: cleaner way to not alter CFLAGS/CPPFLAGS/LDFLAGS",
it seems that the dependency on C++ is not required anymore, so there
is no reason to keep this restriction. Dropping AC_PROG_CXX allows to
build with a toolchain that doesn't have C++ just fine.
Waldir Pimenta [Thu, 7 Dec 2017 18:51:39 +0000 (18:51 +0000)]
LICENSE: add title and copyright notice (#259)
* LICENSE: add title and copyright notice
The title is not legally mandated, but it's recommended in the license template text (see http://choosealicense.com/licenses/isc/ and https://opensource.org/licenses/isc-license).
Vincent Bernat [Sun, 19 Nov 2017 15:38:33 +0000 (16:38 +0100)]
dot3: as PD device, echo back PSE allocated value
Dot3 power TLV contains an allocated value and a requested value. When
PSE allocates some power and says so in its TLV, PD device is expected
to echo back (within 10 seconds) the received value in its own TLV. We
handle this part automatically.
Vincent Bernat [Sun, 22 Oct 2017 19:04:29 +0000 (21:04 +0200)]
priv: provide a simpler sig_chld when priv sep is disabled
We restore the original sig_chld() helper function when privilege
separation is enabled but we use a very simple one when not. This
should still fix the zombie issue.
Vincent Bernat [Mon, 2 Oct 2017 19:52:33 +0000 (21:52 +0200)]
daemon: don't fork at all when using upstart
It seems there is a bug in Upstart state machine. If the process fail
before daemonizing, Upstart says the process will be respawned but that's
not the case. Moreover, Upstart has difficulty to correctly track
daemonization of lldpd (it is confused by the additional process
spawning after initial daemonization, for some reason?).
Vincent Bernat [Fri, 15 Sep 2017 20:38:52 +0000 (22:38 +0200)]
netlink: don't remove interfaces when they are released from a bridge
When released from a bridge, a RTM_DELLINK is sent. We detect there is
an upper device and turn thay into a RTM_NEWLINK. If the interface was
really removed, we would get two RTM_DELLINK (one with master, one
without).
On most setups, another RTM_NEWLINK was sent due to change of promisc
status.
Steven Webster [Wed, 30 Aug 2017 05:43:54 +0000 (01:43 -0400)]
client: add show interfaces command (#240)
There are several lldpcli configure commands that take port name(s)
as an optional parameter.
Currently, it is not possible to verify interface specific configuration
for lldpd without access to a neighbour switch/host or packet capture.
It would be useful to have a show interfaces command, similar to the
show neighbors command that allows a user/agent to query the local
TLV information.
This commit leverages the existing port display infrastructure to
enable display of local interfaces. There are a few differences:
- Do not display the chassis RID, as the local index is always 0
- Show TTL as a seperate TLV based on tx_hold, tx_interval config,
as internally the port TTL atom info is 0, and the chassis TTL
atom info has been depreciated.
Vincent Bernat [Tue, 15 Aug 2017 17:22:00 +0000 (19:22 +0200)]
client: add "json0" to the list of available formats
This enables a more verbose JSON output whose structure is kept
the same with one or several neighbors. It's easier to parse than the
current structure.
Vincent Bernat [Sun, 13 Aug 2017 13:13:07 +0000 (15:13 +0200)]
lldpcli: add "configure system hostname ." to use node name
This is a shortcut to "configure system hostname nodename". By default,
lldpd will use the FQDN (resolving the node name using the local
resolver). We let lldpcli interpret "." as a special request to override
this value with the node name (output of "uname -n").
Vincent Bernat [Sat, 12 Aug 2017 21:15:56 +0000 (23:15 +0200)]
priv: don't run ethtool as root
Kernels older than 2.6.19 won't get any link information. Kernels 4.6,
4.7 and 4.8 won't get information from GLINKSETTINGS (higher speeds)
but they are not LTS kernels so we should be fine. This removes a
bunch of code.
Vincent Bernat [Sat, 12 Aug 2017 19:30:17 +0000 (21:30 +0200)]
interfaces: use ethtool to get permanent MAC for bonds/teams
As this doesn't work for all devices (like dummy and veth), we still
fallback to old code using /proc/net/bonding for bonds. No fallback
available for team devices.
Vincent Bernat [Sat, 12 Aug 2017 18:09:22 +0000 (20:09 +0200)]
interfaces: enable team interfaces like a bond interface
Unfortunately, we are not able to retrieve the real MAC address as the
kernel doesn't know it. Only the teamd daemon knows it. We could ask for
it through ethtool but it would be the permenant MAC address which may
be incorrect.
Steven Webster [Tue, 20 Jun 2017 20:04:38 +0000 (16:04 -0400)]
lldp: clear station bit if any other capability is enabled
The 801.1AB spec states that the station only capability should
not be set in conjunction with any other (capability) bits.
It is possible for the lldpd interface update routine to set the
station bit, while the lldpd chassis update routine may, at a later
time, set the router capability bit. In this case the station bit
is not cleared.
This commit clears the station bit if any other capability is set.