From patchwork Fri Dec 11 07:05:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 1414750 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=phrozen.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=pmiY1Ruu; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cshhy57XXz9sSn for ; Fri, 11 Dec 2020 18:08:50 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kHWmJrrZ1aB5k1OLEZi3SiC/4g9Pck/ghrfXnQrkaRk=; b=pmiY1RuuF6Pbl1tKH1s4qkwp8 LSZIKNDOOJ3CkVRUnl55FK5i8Rdi55NcndgoMSQkSGWLZOVm11AoKWooeJZLoUwtSxjnvQPqfPBH0 Rme8xFbmz8KgLR2ijnom58cZfESS2vDg9akh4ov8Qa9aorda3Ft+7m+LbJaYA7FeyxypHckRbrcb0 gcFVaW3mwAANP4iCSLUg044IISxDI/gm7ijGVK+7ScEQcWJxdfw8noxEeT0RvI4xfikjTDhmZjl4t Ag8yXnJmvFLsxW/FB5kntXvXR+v+SHCXmZFomqwSJPPMxGtI0D9YHi9RXbY5FhLHs7l8PFA4BxQ8I 1QrGr08sw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kncUa-0001l5-JU; Fri, 11 Dec 2020 07:05:28 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kncUW-0001kA-DF for openwrt-devel@lists.openwrt.org; Fri, 11 Dec 2020 07:05:25 +0000 Received: from [149.224.204.217] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1kncUR-0003Jx-VA; Fri, 11 Dec 2020 08:05:20 +0100 From: John Crispin To: OpenWrt Development List Subject: [PATCH 2/2] lldpd: fix init.d script Date: Fri, 11 Dec 2020 08:05:11 +0100 Message-Id: <20201211070511.3515348-2-john@phrozen.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201211070511.3515348-1-john@phrozen.org> References: <20201211070511.3515348-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201211_020524_610808_5F243C09 X-CRM114-Status: GOOD ( 12.59 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Crispin Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org 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 --- 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