From patchwork Mon Jun 21 22:45:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 1495359 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) 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=bombadil.20210309 header.b=pbfzNqaM; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=hauke-m.de header.i=@hauke-m.de header.a=rsa-sha256 header.s=MBO0001 header.b=Qj/9aKX4; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 4G84Tm267rz9sRf for ; Tue, 22 Jun 2021 08:49:28 +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:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oZkFzYAxzOOObnxeqtS97Dfd6bxu3KqlkEX8D062IrY=; b=pbfzNqaMtCLoa7 WUKCrMS6ygBksTaopDL9asfIx/mRk3lLcFRZM0nJ7VUKyzqrp4ZHg/J4jyEzDf6Q43fmkU3DWl6SW 4PTI0H0Arl4U4/1JUqyTI/x9arO3y9fiG5fxni6vJbxgngUTCRckCc5lADzvAVt+GdiXq75XZ1dNa vUcphUoBpPkqAOUwuyMcNzZ193hdezw/7Wx45qpIL7aiuKuleHC3s/AGk3wni2OTz+dXboXGJzrbt EPyT9JzKYWKMP0deHQDT2J60xnSyEtK7YsP/Lbk82UGlGV3ydbBxvWrhrZxT1Pj5uQlTggGvyIKfz A9L3xibykktvj5SWRNCQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvSgH-004zML-Ji; Mon, 21 Jun 2021 22:46:13 +0000 Received: from mout-p-102.mailbox.org ([80.241.56.152]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvSfp-004zIr-W0 for openwrt-devel@lists.openwrt.org; Mon, 21 Jun 2021 22:45:48 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4G84PL3cnXzQjlj; Tue, 22 Jun 2021 00:45:42 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hauke-m.de; s=MBO0001; t=1624315540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PLut8EgJX54Sl187UWV4zJs/6hpwsMLwQr0zTOlDPc8=; b=Qj/9aKX4R3yeODH51FwRAWPA96adb5GGurVCakXFgMF2Z6xjojlLEEKUEWS7AUPLLf9BDD Mut7mCMr2UCEIxbkRiYTj9qi3iApiNntkjkxahbLc5Xr1+oLO1rMbSe+GZXAt/ZVx0g4fV hO3AouNnWT3ooQuyKWNoi9+Td8U41wCOzG/2BlORcFRAV5xOJRGl2PhT7cfiQTEx+4FAv8 KBZtgz/NhEMkTpbXS4FEMZ8obGs6SI3YxVnVm0wMt/CAcAO0lOtvDrukmqqAiPn7QI6uIu eDSQR6g2im1GUALoVb9zXtcCWdLLUX5apDiUextmrtSekYGiUqpM4s6bsN/niw== Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id AU9tboor_24O; Tue, 22 Jun 2021 00:45:38 +0200 (CEST) From: Hauke Mehrtens To: openwrt-devel@lists.openwrt.org Cc: zajec5@gmail.com, devel-sven@geroedel.de, dqfext@gmail.com, mail@birger-koblitz.de, Hauke Mehrtens Subject: [PATCH v2 2/5] base-files: failsafe: Fix IP configuration Date: Tue, 22 Jun 2021 00:45:19 +0200 Message-Id: <20210621224522.633341-3-hauke@hauke-m.de> In-Reply-To: <20210621224522.633341-1-hauke@hauke-m.de> References: <20210621224522.633341-1-hauke@hauke-m.de> MIME-Version: 1.0 X-MBO-SPAM-Probability: * X-Rspamd-Score: 1.29 / 15.00 / 15.00 X-Rspamd-Queue-Id: 253051894 X-Rspamd-UID: 5fdac3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210621_154546_216429_B76E00E1 X-CRM114-Status: GOOD ( 10.39 ) X-Spam-Score: -0.2 (/) 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: Adapt the preinit_config_board() to the board.json network changes. It now looks for the device and the ports variables to configure the LAN network. This works with swconfig configurations. Fixes: FS#3866 Fixes: d42640e389a8 ("base-files: use "ports" array in board.json network for bridges") Signed-off-by: Hauke Mehrtens --- .../base-files/files/lib/preinit/10_indicate [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [80.241.56.152 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_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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 Adapt the preinit_config_board() to the board.json network changes. It now looks for the device and the ports variables to configure the LAN network. This works with swconfig configurations. Fixes: FS#3866 Fixes: d42640e389a8 ("base-files: use "ports" array in board.json network for bridges") Signed-off-by: Hauke Mehrtens Reviewed-by: Rafał Miłecki --- .../base-files/files/lib/preinit/10_indicate_preinit | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/package/base-files/files/lib/preinit/10_indicate_preinit b/package/base-files/files/lib/preinit/10_indicate_preinit index 3c5992979016..56e96c63baab 100644 --- a/package/base-files/files/lib/preinit/10_indicate_preinit +++ b/package/base-files/files/lib/preinit/10_indicate_preinit @@ -72,14 +72,20 @@ preinit_config_board() { json_select network json_select "lan" - json_get_vars ifname + json_get_vars device + json_get_values ports ports json_select .. json_select .. - [ -n "$ifname" ] || return + [ -n "$device" -o -n "$ports" ] || return + + # swconfig uses $device and DSA uses ports + [ -z "$ports" ] && { + ports="$device" + } # only use the first one - ifname=${ifname%% *} + ifname=${ports%% *} if [ -x /sbin/swconfig ]; then # configure the switch, if present