lldpd: fix passing multiple ifnames to the daemon
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 1 Mar 2015 12:25:02 +0000 (12:25 +0000)
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 1 Mar 2015 12:25:02 +0000 (12:25 +0000)
Instead of multiple -I arguments, lldpd expects a comma separated list.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44585 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/network/services/lldpd/Makefile
package/network/services/lldpd/files/lldpd.init

index 88982d1..5a1921e 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lldpd
 PKG_VERSION:=0.7.13
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://media.luffy.cx/files/lldpd
index b2eea70..2b1b223 100644 (file)
@@ -37,14 +37,15 @@ start() {
        local ifaces
        config_get ifaces 'config' 'interface'
 
-       local iface
+       local iface ifnames=""
        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 ifnames "${ifname:-$iface}" ","
                fi
        done
 
+       [ -n "$ifnames" ] && append args "-I $ifnames"
        [ $enable_cdp -gt 0 ] && append args '-c'
        [ $enable_fdp -gt 0 ] && append args '-f'
        [ $enable_sonmp -gt 0 ] && append args '-s'