From patchwork Tue Apr 9 03:41:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Donald X-Patchwork-Id: 1921191 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=nswWHrqZ; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=nlnLnzWp; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VDBgk2XWwz1yYH for ; Tue, 9 Apr 2024 13:45:38 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type: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:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tSWXWEWCR6Ym8plqNO+PyI2w0EN9CxoTkJnWymEmrko=; b=nswWHrqZC89rjh gARktps+UhR8tV4G42WdWRsFGjaGHh5ZRwJ/LkmiV6fuI3pSXGf3WWNxa17jgMtnL7wzaCLL7xnmE 86pVE5RtBH7jGXQZqm6SnOyBS2FLpkis2k1HWNcpFhBWvUB2dEZKvwMHGMoLmyKUgrKZCJUg7g/H7 ZRZR7G/kNrdLdgCl1tXQA8+s/X94nv6dPb62ZnByq4hyWw4xOAhRWZda3adFZiKgr14B9N5ip/f6Y /FMk9spoVDX7fKGayQynCoLHIWwxG4CY0iTzLlTlNnb9kPkY+2CQdMGhcQFyda2AuNKpDJU/XEMm/ N/+Dol37dZckPHj9lFdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ru2PO-00000000CMv-0hjz; Tue, 09 Apr 2024 03:44:30 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ru2P6-00000000CFc-2EHY for openwrt-devel@lists.openwrt.org; Tue, 09 Apr 2024 03:44:13 +0000 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2d4515ec3aaso44177191fa.1 for ; Mon, 08 Apr 2024 20:44:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712634250; x=1713239050; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=jkjgtfiLJrrcEAFQaGh0ypjpD/71wrTftWTY6al96hs=; b=nlnLnzWpBO3j2EgrzX8Sg7LHhxNOScQG6xOTlPubthzljkimENktnnEkxoza/nimp7 MGir4JexzAhHhJD9B3uXeGjw5fm2I6xBCrbfRwCgJx9ZOgYrDUqBmVic52ym4yptSFcZ LlxCh+HqfkYh7b0zNJZDELhu4xPI+YWRYcGVW5tiRx7fD+5rVXZE7IR2Ji7nfKpGgXxa JQwN7F5XOf79I7vLr4mqVMsmSEt9ByBDwxndSkaLmYHjX2BfL0DiYNJKUTlqSku3pbRl jlXCXRLavFKRdXfJvkuo4FrYHrzmSVnRInzbb4KQb1e32p/onvUJ8xwbhqT/slmfAb3v Fq4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712634250; x=1713239050; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=jkjgtfiLJrrcEAFQaGh0ypjpD/71wrTftWTY6al96hs=; b=SL0kpUglIeXW0ALokaXOwCuZyCMgDJvaR06ce22PIEqNcXTjCFutyaa5uk8qcX0AR+ zK2kh04iSIxa0ljKe62VHbyuIgf1hbRp9jGzHmyOxYkrTXrVYP7zP9ONCxe4tTQuJPUK scXy1Ly2omjklhfRI+ZOqzXlxBRewHgSGhqtTZ/kggmSuPztMONy0PDZqcGUOqN9VTNJ pw0nrGgpahAzCWei9PqX9XskXO1TRq8kFXxHKWfubb+LGed5Vhjx5wJgZk5Jyg9f/Dtx mnllLdMYr9ImGCbuItXFX+nShg2+wNy6DS1OoPYJYbtSF5gFEG3KWiKqLd71rDVb74AK BqJA== X-Gm-Message-State: AOJu0YxKi3XLjYh/mgeUlcUYZ2pAel2p3ZAWeD/iYdxLRANt2uYhAiGf zgrb5wKhfv04wrpTrXYN4IBn0ZD03DVNJ+IynTR94dfDSzkjibvzJ7AMPxVv X-Google-Smtp-Source: AGHT+IEhmT/hK6b9uioL/iFhU5hKRfo5HZ6P+VaA6ZeMaL/cmSs+QmDXmaA52w12m9lb7CGV3NCC2g== X-Received: by 2002:a05:651c:10c4:b0:2d6:9054:5b5c with SMTP id l4-20020a05651c10c400b002d690545b5cmr324850ljn.26.1712634249616; Mon, 08 Apr 2024 20:44:09 -0700 (PDT) Received: from blackhol3 ([2001:9b0:40::cae3:cb03]) by smtp.gmail.com with ESMTPSA id n9-20020a2e86c9000000b002d2191e20e1sm1374790ljj.92.2024.04.08.20.44.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 20:44:08 -0700 (PDT) From: Paul Donald To: OpenWrt Development List Subject: [PATCH v2 5/7] lldpd: make capabilities advertisement controllable Date: Tue, 9 Apr 2024 05:41:05 +0200 Message-ID: <20240409034405.78194-6-newtwen+github@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240409034405.78194-1-newtwen+github@gmail.com> References: <20240402130221.58706-1-newtwen+github@gmail.com> <20240409034405.78194-1-newtwen+github@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240408_204412_590555_B050FFA2 X-CRM114-Status: UNSURE ( 9.30 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.6 (+) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Defaults to off. Only available from >= 1.0.15 These capabilities are sent in TLV. Content analysis details: (1.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:229 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [newtwen+github(at)gmail.com] 1.8 LONGWORDS Long string of long words X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Defaults to off. Only available from >= 1.0.15 These capabilities are sent in TLV. Signed-off-by: Paul Donald --- package/network/services/lldpd/files/lldpd.init | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init index 284c37c2ef..83af6649a9 100644 --- a/package/network/services/lldpd/files/lldpd.init +++ b/package/network/services/lldpd/files/lldpd.init @@ -124,6 +124,10 @@ write_lldpd_conf() local lldp_syscapabilities config_get lldp_syscapabilities 'config' 'lldp_syscapabilities' + # Configurable capabilities in lldpd >= v1.0.15 + local lldp_capability_advertisements + config_get_bool lldp_capability_advertisements 'config' 'lldp_capability_advertisements' 0 + if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ]; then local lldpmed_fast_start config_get_bool lldpmed_fast_start 'config' 'lldpmed_fast_start' 0 @@ -164,6 +168,7 @@ write_lldpd_conf() [ -n "$lldp_hostname" ] && echo "configure system hostname" "\"$lldp_hostname\"" >> "$LLDPD_CONF" [ -n "$lldp_mgmt_ip" ] && echo "configure system ip management pattern" "\"$lldp_mgmt_ip\"" >> "$LLDPD_CONF" [ -n "$lldp_syscapabilities" ] && echo "configure system capabilities enabled $lldp_syscapabilities" >> "$LLDPD_CONF" + if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ] && [ "$lldpmed_fast_start" -gt 0 ]; then if [ "$lldpmed_fast_start_tx_interval" -gt 0 ]; then echo "configure med fast-start tx-interval $lldpmed_fast_start_tx_interval" >> "$LLDPD_CONF" @@ -189,6 +194,7 @@ write_lldpd_conf() [ -n "$lldp_platform" ] && echo "configure system platform" "\"$lldp_platform\"" >> "$LLDPD_CONF" [ -n "$lldp_tx_interval" ] && echo "configure lldp tx-interval $lldp_tx_interval" >> "$LLDPD_CONF" [ "$lldp_tx_hold" -gt 0 ] && echo "configure lldp tx-hold $lldp_tx_hold" >> "$LLDPD_CONF" + [ "$lldp_capability_advertisements" -gt 0 ] && echo "configure lldp capabilities-advertisements" >> "$LLDPD_CONF" # Since lldpd's sysconfdir is /tmp, we'll symlink /etc/lldpd.d to /tmp/$LLDPD_CONFS_DIR [ -e "$LLDPD_CONFS_DIR" ] || ln -s /etc/lldpd.d "$LLDPD_CONFS_DIR" @@ -367,6 +373,7 @@ reload_service() { $LLDPCLI -u "$LLDPSOCKET" >/dev/null 2>&1 <<-EOF pause unconfigure lldp custom-tlv + unconfigure lldp capabilities-advertisements unconfigure system interface pattern unconfigure system description unconfigure system hostname