From patchwork Tue Apr 2 13:02:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Donald X-Patchwork-Id: 1918784 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=4tSpwyKi; 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=aAP2lMUS; 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 4V87PC0shLz1yYB for ; Wed, 3 Apr 2024 00:03:59 +1100 (AEDT) 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=WUvbulBwhd1EMPF7MT3wSWUSzlag7c6cl2sMeWgngoI=; b=4tSpwyKiHABxZt hX1J/Jowdpwd2GoWfQ08w64pJuVwtkbZOZ/7a2E3EYjEjf+PitQFlTFH4MOx46kgzRMo58D3wORdC HDMK5ismaZD+G4p+VyYmplHgoDnUqhe70ZU9iujtaOc6Iaw3J844o5hnhm/rNC6dchOpnULq/G1M2 h5xwv3HBxR+eY7BW8p6Yetykx4uh4byEzjKY07fBPENbS9PuBK22VuO7eJYmMKt0LWTecVuaziiX5 dPyVlLBJ1IR3CDddksQDLDv8MP0Yt4vVPdRxwDVK1K5RfTDhuh8wPkVOOCU3h/cG6tvaf34E4dLaK gmTccPZftBq1JVOWU7Bw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrdmZ-0000000BDRq-1ffW; Tue, 02 Apr 2024 13:02:31 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrdmV-0000000BDQX-36Qc for openwrt-devel@lists.openwrt.org; Tue, 02 Apr 2024 13:02:28 +0000 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-516b80252c6so443625e87.0 for ; Tue, 02 Apr 2024 06:02:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712062946; x=1712667746; 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=GUcsWqJQ2fMHHRRogyFeem/TLC5Rx7oDoRVPuGsL9+g=; b=aAP2lMUSNBHt009nbAQ48UA0QGcBQdIqpHaQrjXnkBocTHcDcPUQEoqlWEd3mOLGCe Wvf4FHowWPmKFkrNQJAAwi/Oz+M9SsowNaGgbyONJWeyRBUnpGQ8TCrSY8KvsK7CzaGh 18Xir7hCIU0cJmTTKjMBLOpg/jYKbD08y16voQQENuAiT9TIUGOjxEh8fO4r6jp/vxPq Rrefgtw841m0pTCVuPbJqAEDfZChpBQsgJhQmwxW7sbdvQqxq8KuhLL4DbiyrAox27Z+ ERmzMuLR7xZs19DP9QM86SMDFJHuQw6mtt1H4OcPuQTjxYTgicsLrdM+k8hx3dXt2zkk BwOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712062946; x=1712667746; 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=GUcsWqJQ2fMHHRRogyFeem/TLC5Rx7oDoRVPuGsL9+g=; b=BKM5QumOqcS1SsUh8RrxsJhUh/76B2XemQGHU4jIpPY0RsZ7QQTND+IZ5vFj5VUx1c 4XNLsWDMEtb5v/ErYBmEW4irNIPzi8O3K8dOfjPRM7mV+BzMoesqfzZT6y6NleNqonRd 5hDOAa7gLP211h2vRIfl3XWOKzsr8gC0FBIg9fiHM+qtHUay6rD7Pd1BWVmZZPtgvHQ9 qjZ8P0fgp6XJv2MNBah2c8lq12I6IOb3mP2VoDQmwrpjk2wRb1bglyowp7OLI8sQe1zu MNIXhavoo8f/J0AnunY83thyWhChYzGSx2+gZv1ksvSKTfnkNQ8SvkozE3eQ7Zh9tIXK pyBA== X-Gm-Message-State: AOJu0Yz2hhmgTyBNyReVAvk7rUfDpO6qD25t4HCyxFRdZsihcNN1epyu sEwQ2xfaJaDQiaOKsvYLCqKi15B9Gy3yiSzY/tIHKqpf3Adx0xlo6XjwArrE X-Google-Smtp-Source: AGHT+IHP2HJ4bco99fxsnD1Fl/plAtU9mUcXEyyPMfker+4oq5XCEcj2yNHGKxcJ5gXto48F9DK+jw== X-Received: by 2002:ac2:47f8:0:b0:515:acca:d75b with SMTP id b24-20020ac247f8000000b00515accad75bmr7912536lfp.22.1712062945521; Tue, 02 Apr 2024 06:02:25 -0700 (PDT) Received: from blackhol3 ([2001:9b0:40::cae3:cb03]) by smtp.gmail.com with ESMTPSA id d8-20020ac241c8000000b00515fc468f45sm995071lfi.31.2024.04.02.06.02.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 06:02:24 -0700 (PDT) From: Paul Donald To: openwrt-devel@lists.openwrt.org Subject: [PATCH 5/7] lldpd: make capabilities advertisement controllable Date: Tue, 2 Apr 2024 15:02:19 +0200 Message-ID: <20240402130221.58706-5-newtwen+github@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240402130221.58706-1-newtwen+github@gmail.com> References: <20240402130221.58706-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-20240402_060227_809070_774648B2 X-CRM114-Status: UNSURE ( 8.20 ) 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:12f 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_VALID_AU Message has a valid DKIM or DK signature from author's domain 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_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..3e804cd033 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_capadv + config_get_bool lldp_capadv 'config' 'lldp_capadv' 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_capadv" -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