[OpenWrt-Devel] [PATCH][RESEND] lldpd: fix init script for multiple interfaces

Alexandru Ardelean ardeleanalex at gmail.com
Fri Feb 27 15:41:24 EST 2015


The lldpd daemon requires only 1 -I parameter with all interfaces
joined with commas.

So, it needs:
  /usr/sbin/lldpd -I lan1,lan2,...,lanX
versus
  /usr/sbin/lldpd -I lan1 -I lan2 ... -I lanX

The latter seems to take into consideration only lanX,
while other devices are ignored by lldpd.

Signed-off-by: Alexandru Ardelean <ardeleanalex at gmail.com>
---
 package/network/services/lldpd/files/lldpd.init | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init
index b2eea70..bbb5c74 100644
--- a/package/network/services/lldpd/files/lldpd.init
+++ b/package/network/services/lldpd/files/lldpd.init
@@ -41,9 +41,10 @@ start() {
 	for iface in $ifaces; do
 		local ifname=""
 		if network_get_device ifname "$iface" || [ -e "/sys/class/net/$iface" ]; then
-			append args "-I ${ifname:-$iface}"
+			append args "${ifname:-$iface}"
 		fi
 	done
+	[ -n "$args" ] && args="-I `echo $args | tr ' ' ','`"
 
 	[ $enable_cdp -gt 0 ] && append args '-c'
 	[ $enable_fdp -gt 0 ] && append args '-f'
-- 
1.8.4.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list