From patchwork Tue Oct 15 10:13:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evan Jobling X-Patchwork-Id: 1997294 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=xYEFM3Ln; 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 4XSVNR6hxjz1xsc for ; Tue, 15 Oct 2024 21:15:35 +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-Type:List-Help: Reply-To:List-Archive:List-Unsubscribe:List-Subscribe:From:List-Post:List-Id: Message-ID:MIME-Version:To:Subject:Date:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=ZZ4HMwctiGjndR/5C0lDl+AWnQG4XSLwEAXFtIdWa44=; b=xYEFM3LnCjOEl6pYxbfAKDhfdO AVkEPvWkSYCL14OQkvjOxqISXh0WhITi+5BQKTdxpfiGmmdloiEhoE1mrS1ldh7dcM0cGGrzei/cm fcRXYlwgv5EcVS2EAX8ijmCHkDX7LMk9nXBs80QUcDjoG0BfSPEs4s6aqElDnjOSgi1c8LtzftqNP NB1Nieco21OEISm5dOWSFayFRojUdwAQ/4K3IjsWEeCEVDImhUJR6fxUCh9VH7RHwLn0TNDNcynUu alufB12l290F5XxrUQBOi/47bXiLfNeF3kLbu4xC88hcWRC+QLI1Du+ETQpiTYlzePQwXNk5YPFGp WD+VA8rQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0eYH-00000007mt0-2XGs; Tue, 15 Oct 2024 10:13:17 +0000 Date: Tue, 15 Oct 2024 21:13:10 +1100 Subject: [PATCH 2/5] base-files: ucidef netdev altname, label and alias To: openwrt-devel MIME-Version: 1.0 Message-ID: List-Id: OpenWrt Development List List-Post: X-Patchwork-Original-From: Evan Jobling via openwrt-devel From: Evan Jobling Precedence: list X-Mailman-Version: 2.1.34 X-BeenThere: openwrt-devel@lists.openwrt.org List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: Evan Jobling List-Help: Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software. In addition to path, conduit and gro options. Allow for setting options for more network device configuration in preinit. Adding in preparation for more configuration in preinit. A second label pass is required, in case of conflicts with the path variable and the network interface doesn't have a .ethernet handle. For example DSA devices where their label conflicts with the desired port name. An altname pass (requiring ip-full) could mitigate issues when migrating configurations if one wishes to rename devices in preinit. A device specific example: For example in the Firebox M300 default interface names are eth0-eth7 with eth3-eth7 being ports on a dsa switch. eth3 and eth4 start out as being the conduit interfaces. The old names for the devices would be sweth3 through sweth7. One could set the altname property to keep existing configurations working. Or the alias to keep the names coming up in ip-link whilst not being able to up/down the interface with that handle. Signed-off-by: Evan Jobling --- .../base-files/files/lib/functions/uci-defaults.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh index 8355099c35..7997e49d83 100644 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -122,6 +122,18 @@ ucidef_set_network_device_path() { _ucidef_set_network_device_common $1 path $2 } +ucidef_set_network_device_label() { + _ucidef_set_network_device_common $1 label $2 +} + +ucidef_set_network_device_altname() { + _ucidef_set_network_device_common $1 altname $2 +} + +ucidef_set_network_device_alias() { + _ucidef_set_network_device_common $1 alias $2 +} + ucidef_set_network_device_gro() { _ucidef_set_network_device_common $1 gro $2 }