Vincent Bernat [Wed, 29 Feb 2012 22:14:41 +0000 (23:14 +0100)]
lldpd: do not stay stuck in the receive loop
On some corner case conditions, we can stay stuck in the receive loop
because we did not send packets for more than 30 seconds. In this
case, we keep reset the timeout to 30 seconds and we cannot exit the
loop (since the first condition to exit the loop is to have reached
the timeout).
Therefore, we invert the condition. If we have stay too long in the
loop, just exit. We know for sure that we will hit lldpd_send_all()
soon and get back to a sane state.
Also, in receive only state, we are also stuck in the loop. This
forbids us to update data about local chassis and interfaces. We also
fix this.
Vincent Bernat [Mon, 2 Jan 2012 07:27:43 +0000 (08:27 +0100)]
core: optimize BPF filter
When monitoring high trafic interfaces, the BPF filter can become
quite important. We optimize it a bit by first checking if the
ethernet address is a multicast one. If it is not, we only have to
check for EDP.
Vincent Bernat [Sat, 31 Dec 2011 09:52:03 +0000 (10:52 +0100)]
configure: check more SNMP stuff.
First, we check that netsnmp_enable_subagent() exists. Otherwise, this
means that Net-SNMP has been compiled without this feature.
Second, we check if <net-snmp/agent/util_funcs.h> header is
usable. There was incomplete installation of files required by this
header with NetSNMP 5.4 and situation got worse with NetSNMP 5.7. If
the header is not usable, we fallback to define the two functions that
we need.
Vincent Bernat [Fri, 2 Dec 2011 06:35:02 +0000 (07:35 +0100)]
Export TZ=/etc/localtime to fix timestamps.
While chrooted, syslog timestamps does not respect the configured
timezone despite the copy of /etc/localtime inside the chroot. Setting
TZ variable seems to fix this problem.
Vincent Bernat [Thu, 3 Nov 2011 21:44:54 +0000 (22:44 +0100)]
Extend whitelist with possibility to blacklist.
It is possible to specify patterns like "*,!eth1" to blacklist "eth1"
or something like "eth*,wlan*,!wlan*master" to listen to all eth
interfaces and wlan interfaces with the exception of interfaces like
"wlan0master".
Vincent Bernat [Wed, 26 Oct 2011 13:56:07 +0000 (15:56 +0200)]
Don't pack struct hmsg since we are not able to do unaligned access on some archs.
Packing was used because data was cast as a pointer and therefore,
header was padded excessively. Since we don't use it as a pointer, we
cast it as an incomplete array of chars. We don't need its size.
Michael Tremer [Sat, 28 May 2011 12:29:33 +0000 (14:29 +0200)]
Add support to read /etc/os-release for system information.
/etc/os-release is introduced with systemd which will be in all the
major distributions, soon. For backwards-compatibility, the lsb_release
method is still there and will be used if no /etc/os-release is available.
Vincent Bernat [Sat, 5 Jun 2010 17:51:55 +0000 (19:51 +0200)]
Add support for 802.3at.
This includes send and receive support as well as SNMP support.
802.3at seems to not define OID that should be used as well as the
mapping for bit values. Therefore, the implementation is a wild guess
of what is consistent with 802.1ab.
Vincent Bernat [Sat, 8 May 2010 15:25:35 +0000 (17:25 +0200)]
Add initial Dot3/802.3at support
This includes ability to receive and store Dot3 MDI power TLV, to
display them with lldpctl and to export them through SNMP agent. There
is no support for 802.3af yet.
Vincent Bernat [Wed, 9 Jun 2010 16:13:43 +0000 (18:13 +0200)]
Add smart mode support.
This features was removed in previous versions to allow to have
several neighbors on one port. It now uses a different approach. Each
port can still have several neighbors but some of them will be hidden.
Vincent Bernat [Tue, 8 Jun 2010 16:45:52 +0000 (18:45 +0200)]
Don't check CDP checksums.
Some VLAN encapsulated CDP frames seem to have a checksum difficult to
verify. We give up on checking correctly CDP checksums. It is turned
into a dead code for future reference.
Vincent Bernat [Tue, 8 Jun 2010 16:39:18 +0000 (18:39 +0200)]
Listen on VLAN using an appropriate BPF filter and VLAN decapsulation.
Three cases may happen:
- You have a non VLAN accelerated network card.
The BPF filter will catch the frames in the VLAN and the frame will
be decapsulated.
- You have a VLAN accelerated network card and a kernel < 2.6.27.
lldpd won't see any frame encapsulated into a VLAN.
- You have a VLAN accelerated network card and a kernel >= 2.6.27.
lldpd will see the frames encapsulated into a VLAN as untagged
frames and won't need to decapsulate them.
Vincent Bernat [Tue, 8 Jun 2010 15:49:33 +0000 (17:49 +0200)]
Remove "listen on VLAN" feature.
This feature was intrusive and not very well tested. We will replace
it with less code using the fact that a recent kernel is able to
listen on all VLAN is asked to.
Vincent Bernat [Wed, 12 May 2010 18:06:02 +0000 (20:06 +0200)]
Fix additional alignment issues for ARM platform.
This solves the following GCC warnings:
interfaces.c: In function ‘iface_minimal_checks’:
interfaces.c:421: warning: cast increases required alignment of target type [-Wcast-align]
interfaces.c: In function ‘lldpd_ifh_eth’:
interfaces.c:732: warning: cast increases required alignment of target type [-Wcast-align]
interfaces.c: In function ‘lldpd_ifh_mgmt’:
interfaces.c:1127: warning: cast increases required alignment of target type [-Wcast-align]
Vincent Bernat [Wed, 12 May 2010 09:42:20 +0000 (11:42 +0200)]
Fix AC_CHECK_DECLS macro in configure.ac
This macro does not behave like AC_CHECK_FUNCS whose content is copied
in a shell for loop. Therefore, extra spaces may be turned into
underscores. We keep multiple lines but we remove backslashes and
extra spaces.
Vincent Bernat [Mon, 3 May 2010 13:27:15 +0000 (15:27 +0200)]
Revert "Blacklist VMWare interfaces (as per ticket #40)."
It seems that vnetX interfaces are also used by other virtualization
solutions. From now on, we rely only on the queue len of the interface
and not on the name.
Vincent Bernat [Sun, 11 Apr 2010 12:53:32 +0000 (14:53 +0200)]
Ignore interfaces with no queue.
This filters out vnet* interfaces and some others. It seems that
physical (real or virtual) interfaces always have a queue. We might
also check qdisc. If "noop", this means that the interface is a
blackhole and should be ignored. However, we wait for an actual
interface to exhibit a behaviour where such a detection is needed.