[PATCH 2/2] lldpd: fix init.d script
John Crispin
john at phrozen.org
Fri Dec 11 02:05:11 EST 2020
The script was missing the reload trigger. Additionally running lldpid on a
bridge is not correct. Rather than running lldpd on the L3 bridge, it needs
to be run on all the L2 members.
Signed-off-by: John Crispin <john at phrozen.org>
---
package/network/services/lldpd/files/lldpd.init | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init
index 7a5b25e016..8200556786 100644
--- a/package/network/services/lldpd/files/lldpd.init
+++ b/package/network/services/lldpd/files/lldpd.init
@@ -10,6 +10,10 @@ LLDPSOCKET=/var/run/lldpd.socket
LLDPD_CONF=/tmp/lldpd.conf
LLDPD_CONFS_DIR=/tmp/lldpd.d
+service_triggers() {
+ procd_add_reload_trigger lldpd
+}
+
find_release_info()
{
[ -s /etc/os-release ] && . /etc/os-release
@@ -38,6 +42,10 @@ write_lldpd_conf()
for iface in $ifaces; do
local ifname=""
if network_get_device ifname "$iface" || [ -e "/sys/class/net/$iface" ]; then
+ if [ -e "/sys/class/net/$ifname/bridge" -o -e "/sys/class/net/$ifname/lower_bridge" ] ; then
+ local ports=$(jsonfilter -i /etc/board.json -e "@.network.$iface.ifname")
+ [ "${ports// /,}" ] && ifname="${ports// /,}"
+ fi
append ifnames "${ifname:-$iface}" ","
fi
done
--
2.25.1
More information about the openwrt-devel
mailing list