From patchwork Fri Feb 27 16:23:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 444335 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B502C140119 for ; Sat, 28 Feb 2015 03:23:36 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=VZFMS8FB; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 0E4D328A248; Fri, 27 Feb 2015 17:23:17 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 7F688280734 for ; Fri, 27 Feb 2015 17:23:12 +0100 (CET) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Fri, 27 Feb 2015 17:23:12 +0100 (CET) Received: by wibbs8 with SMTP id bs8so1395450wib.0 for ; Fri, 27 Feb 2015 08:23:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=4LWMXvqIgczTJX+ZOHEyJBLVMv3qS9T3dsASU+bHIrk=; b=VZFMS8FB+JUGez12a1+8ipUmgFU12FJNawo10jxOB59/twcCb0smtaAHrj3Ydy/twd EqtWqAjRusf0SG44p63rrRJEP2d9xUGYHgq8sF7lh8lzPADnAiMZiedrf7jwcKzTBOyO N7uSiA6OD4g0u3Xy5c05I2LR7opGkJBpjmngZmtwA/n05C5Aq46Q0zbkQkC4eqybqJ6v LtH6Ii6aJ1aE+zjeyv+Y96S91O42xjwBzs8oRBiyYfNifs0Kav+BRT2l+AnfEBHePOwl haDI2PE7SZNPsI7+ko+5TCI8pL6hlxabXNd1BbWpXcbehL5mVSmp9TfwOyKVHFdjqy2a 41Cw== X-Received: by 10.180.84.9 with SMTP id u9mr7718292wiy.91.1425054203178; Fri, 27 Feb 2015 08:23:23 -0800 (PST) Received: from orion.local ([194.105.29.179]) by mx.google.com with ESMTPSA id bf8sm6583358wjb.37.2015.02.27.08.23.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Feb 2015 08:23:22 -0800 (PST) From: Alexandru Ardelean To: openwrt-devel@lists.openwrt.org Date: Fri, 27 Feb 2015 18:23:16 +0200 Message-Id: <1425054196-18340-1-git-send-email-ardeleanalex@gmail.com> X-Mailer: git-send-email 2.1.2 Subject: [OpenWrt-Devel] [PATCH] lldpd: fix init script for multiple interfaces X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" 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 --- package/network/services/lldpd/files/lldpd.init | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init index b2eea70..d29980e 100644 --- a/package/network/services/lldpd/files/lldpd.init +++ b/package/network/services/lldpd/files/lldpd.init @@ -37,13 +37,18 @@ start() { local ifaces config_get ifaces 'config' 'interface' + local ifnames_joined="" local iface 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_joined "${ifname:-$iface}" fi done + if [ -n "$ifnames_joined" ]; then + ifnames_joined=`echo $ifnames_joined | tr " " ","` + append args "-I $ifnames_joined" + fi [ $enable_cdp -gt 0 ] && append args '-c' [ $enable_fdp -gt 0 ] && append args '-f'