Do not enable port if already enabled
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
This commit is contained in:
parent
58f2b56a94
commit
637b9881f8
10
lldpad.spec
10
lldpad.spec
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
Name: lldpad
|
Name: lldpad
|
||||||
Version: 1.0.1
|
Version: 1.0.1
|
||||||
Release: 15.git%{checkout}%{?dist}
|
Release: 16.git%{checkout}%{?dist}
|
||||||
Summary: Intel LLDP Agent
|
Summary: Intel LLDP Agent
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
URL: http://open-lldp.org/
|
URL: http://open-lldp.org/
|
||||||
@ -49,6 +49,10 @@ Patch28: open-lldp-v1.0.1-28-support-DSCP-selectors.patch
|
|||||||
# https://github.com/intel/openlldp/pull/7
|
# https://github.com/intel/openlldp/pull/7
|
||||||
Patch29: open-lldp-v1.0.1-29-basman_clif-print-the-OID-properly.patch
|
Patch29: open-lldp-v1.0.1-29-basman_clif-print-the-OID-properly.patch
|
||||||
|
|
||||||
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1752207
|
||||||
|
# https://github.com/intel/openlldp/pull/31
|
||||||
|
Patch30: open-lldp-v1.0.1-30-lldpad-Do-not-enable-port-if-already-enabled.patch
|
||||||
|
|
||||||
BuildRequires: automake autoconf libtool
|
BuildRequires: automake autoconf libtool
|
||||||
BuildRequires: flex >= 2.5.33
|
BuildRequires: flex >= 2.5.33
|
||||||
BuildRequires: kernel-headers >= 2.6.32
|
BuildRequires: kernel-headers >= 2.6.32
|
||||||
@ -118,6 +122,10 @@ rm -f %{buildroot}%{_libdir}/liblldp_clif.la
|
|||||||
%{_libdir}/liblldp_clif.so
|
%{_libdir}/liblldp_clif.so
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sat Sep 14 2019 Ido Schimmel <idosch@mellanox.com> - 1.0.1-16.git036e314
|
||||||
|
- Add open-lldp-v1.0.1-30-lldpad-Do-not-enable-port-if-already-enabled.patch
|
||||||
|
(BZ 1752207)
|
||||||
|
|
||||||
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-15.git036e314
|
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-15.git036e314
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||||
|
|
||||||
|
@ -0,0 +1,63 @@
|
|||||||
|
From 78fd49291293d9f0da5b1bfa064a477c221cf6f8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ido Schimmel <idosch@mellanox.com>
|
||||||
|
Date: Sun, 11 Aug 2019 17:16:44 +0300
|
||||||
|
Subject: [PATCH] lldpad: Do not enable port if already enabled
|
||||||
|
|
||||||
|
When a port is enslaved to a bridge, the kernel will emit multiple
|
||||||
|
RTM_NEWLINK messages for the port when the bridge device is brought down
|
||||||
|
and then up. Assuming 'swp3' is enslaved to 'br0', the following link
|
||||||
|
events will be generated when 'br0' is toggled:
|
||||||
|
|
||||||
|
# ip monitor link
|
||||||
|
9: swp3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state UP
|
||||||
|
link/ether 7c:fe:90:ff:27:d1
|
||||||
|
31: br0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN group default
|
||||||
|
link/ether 7c:fe:90:ff:27:d1 brd ff:ff:ff:ff:ff:ff
|
||||||
|
9: swp3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state UP
|
||||||
|
link/ether 7c:fe:90:ff:27:d1
|
||||||
|
9: swp3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state UP
|
||||||
|
link/ether 7c:fe:90:ff:27:d1
|
||||||
|
31: br0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state DOWN group default
|
||||||
|
link/ether 7c:fe:90:ff:27:d1 brd ff:ff:ff:ff:ff:ff
|
||||||
|
31: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
|
||||||
|
link/ether 7c:fe:90:ff:27:d1 brd ff:ff:ff:ff:ff:ff
|
||||||
|
9: swp3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state UP
|
||||||
|
link/ether 7c:fe:90:ff:27:d1
|
||||||
|
|
||||||
|
These events will cause lldpad to invoke lldp_mod_ifup() multiple times
|
||||||
|
for 'swp3' despite the fact the port is already enabled as far as lldpad
|
||||||
|
is concerned.
|
||||||
|
|
||||||
|
In the specific case of the 802.1Qaz module, multiple invocations of
|
||||||
|
ieee8021qaz_ifup() will result in the port being stuck in 'pending'
|
||||||
|
state. The state can be cleared by the dormant timer, but this is never
|
||||||
|
initialized as the port's operational state is always 'UP' as evident by
|
||||||
|
the generated events.
|
||||||
|
|
||||||
|
Fix this by preventing lldpad from enabling the port if it is already
|
||||||
|
enabled.
|
||||||
|
|
||||||
|
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
|
||||||
|
Reported-by: Alex Kushnarov <alexanderk@mellanox.com>
|
||||||
|
Tested-by: Alex Kushnarov <alexanderk@mellanox.com>
|
||||||
|
---
|
||||||
|
event_iface.c | 3 +++
|
||||||
|
1 file changed, 3 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/event_iface.c b/event_iface.c
|
||||||
|
index 0a4105278bf3..43a95c78c89a 100644
|
||||||
|
--- a/event_iface.c
|
||||||
|
+++ b/event_iface.c
|
||||||
|
@@ -205,6 +205,9 @@ int oper_add_device(char *device_name)
|
||||||
|
port = newport;
|
||||||
|
} else if (is_bond(device_name) || !port->portEnabled)
|
||||||
|
reinit_port(device_name);
|
||||||
|
+ else if (port->portEnabled) {
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
lldp_add_agent(device_name, NEAREST_BRIDGE);
|
||||||
|
lldp_add_agent(device_name, NEAREST_NONTPMR_BRIDGE);
|
||||||
|
--
|
||||||
|
2.21.0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user