From patchwork Tue Apr 2 12:36:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Donald X-Patchwork-Id: 1918776 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=cA5IAq2j; 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=MrtjypM2; 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 4V86ql645wz1yZ3 for ; Tue, 2 Apr 2024 23:38:25 +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: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:In-Reply-To:References: List-Owner; bh=I96P/l8rwDTpkybcSfD78fzCRnvY9MolVim0OpxgAtc=; b=cA5IAq2jNKBJrK x+jeZ31vCZajpFyKTTqarek2B3l2dWyOjwTw27fY1qcTjpo+wgYogBC1czRh+I9AYzMot01imlsQB BLAkDcShd8k6JDKnnUCeYFFDqocq1F8KATMg2pK/0UxijDQ0BK64JXmy20atI3F3boNPJq/MCiigo FuSHFeawXdK6dka6S8srDWBpZCnAGiqadEUmD3LWRByGdautDjxq7VSSItoyIBw1hgXN8x+1gGzzk rBrMKxH06gD7jY1GC6GrYeuVAG2DXJ0QvAKy8h6zlr0bK2RVW6tcA/jn/FPAOPhR+JnbVJ3BsQpIz UYeAPYkH+YmKV/YZvrQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrdNl-0000000B4pZ-2l3V; Tue, 02 Apr 2024 12:36:53 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrdNZ-0000000B4hk-0I2b for openwrt-devel@lists.openwrt.org; Tue, 02 Apr 2024 12:36:42 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-513d23be0b6so5586540e87.0 for ; Tue, 02 Apr 2024 05:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712061397; x=1712666197; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:sender:from:to:cc:subject:date:message-id:reply-to; bh=G1pQdN3sYXALQ475vfJtGk10MtS8LYuQ2FuMdtOU09g=; b=MrtjypM2jkTxfV/srI7WBCZYwAQMEnAvHj3CME6B30jkVDipcZmSJPyKEZvzYQGQs/ 3dkcsr2x/6KLahR+y9ypsYsbYyd4HukNSXCx/prZx/GiBqZ6vkDuXgx2pghjSM0g8FmV ipyyf8I2MDeFITXX4rk5nrU4xpMBkPLVuzWymePQnn9AKW1R1UhQLz1Yv+iCNIZ7d1l7 cKlzc/l7cP/0nxjm7XFF7iuak2hh3J1B8NXz8r7dz8QcuDDYIAFjPiyaeras/69kdtrR r8QXE82E+sUCRUK6o0yjvMAvUzBy21DDw0zEF5h4nQE9/aypRjM70WjCNTmvrPE0w5In dYxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712061397; x=1712666197; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=G1pQdN3sYXALQ475vfJtGk10MtS8LYuQ2FuMdtOU09g=; b=nnq0+RsLPR4COVrNACYJRhZURqKhi0pVzTNWTeNdfEijJ0WbhwAbc2BqX9XvQo7Uqa nSxvsP/ong4vWTdNwTXKh8XOsCUcT9a+wa45jTgnB1QkM6lubIB5MLzMDS6PYKsa4nlQ rbLazwQtJY4+YJ4bw8fQNQf+Z8i+WAd+Yip8/+ZMKX9d0I3rHvw1YbNjzEK7gIk6foDH IzjNSRTM5rZlejAq2KgePs4ZukhLnVcUogJFPTeIoLKUE0E3OOeYg8L0Sn7Yf4zMhSPJ vxkhPpUqthXRhJentqG1Y8trCrYN210bBS3Kds7t6cShn3m3YfjRgFvyVNxdzneu443d SCWQ== X-Gm-Message-State: AOJu0YxKC2WPsZa5YXNUwU1R9qrAlQrNv6oEQ3REuQQqW1N7aDOFFp44 NzJiGXG1xxNaoU8xTj4vpngPRSs2wfE/cdr5qnotgvnUerIWUZ6neDjeVBhF X-Google-Smtp-Source: AGHT+IGFY99f0Zf16y2tSSWT9VAnb+Wq1ZP0m7lAm8rCOExy38N5+wXXVEXB0eVnoFQva7/e/nj/8g== X-Received: by 2002:a05:6512:3ee:b0:513:bebd:79d4 with SMTP id n14-20020a05651203ee00b00513bebd79d4mr8585263lfq.49.1712061397006; Tue, 02 Apr 2024 05:36:37 -0700 (PDT) Received: from blackhol3 ([2001:9b0:40::cae3:cb03]) by smtp.gmail.com with ESMTPSA id i27-20020a0565123e1b00b00515a36f5735sm1702581lfv.61.2024.04.02.05.36.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 05:36:36 -0700 (PDT) From: Paul Donald To: openwrt-devel@lists.openwrt.org Subject: [PATCH] base-files: reduce IPv6 ULA prefix generation to a single call Date: Tue, 2 Apr 2024 14:36:36 +0200 Message-ID: <20240402123636.58237-1-newtwen+github@gmail.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240402_053641_235854_21C4D674 X-CRM114-Status: UNSURE ( 7.54 ) X-CRM114-Notice: Please train this message. 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: Tested on: 23.05.3 Signed-off-by: Paul Donald --- .../files/etc/uci-defaults/12_network-generate-ula | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/package/base-files/files/etc/uci-defaults/12_network-generate-ula b/package/base-files/files/etc/uci-defaults/12_network-generate-ula index 19d7ed7f2e..20b3237ec7 100644 --- a/package/bas [...] 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 [2a00:1450:4864:20:0:0:0:134 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] 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 Tested on: 23.05.3 Signed-off-by: Paul Donald --- .../files/etc/uci-defaults/12_network-generate-ula | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/package/base-files/files/etc/uci-defaults/12_network-generate-ula b/package/base-files/files/etc/uci-defaults/12_network-generate-ula index 19d7ed7f2e..20b3237ec7 100644 --- a/package/base-files/files/etc/uci-defaults/12_network-generate-ula +++ b/package/base-files/files/etc/uci-defaults/12_network-generate-ula @@ -1,11 +1,9 @@ [ "$(uci -q get network.globals.ula_prefix)" != "auto" ] && exit 0 -r1=$(dd if=/dev/urandom bs=1 count=1 |hexdump -e '1/1 "%02x"') -r2=$(dd if=/dev/urandom bs=2 count=1 |hexdump -e '2/1 "%02x"') -r3=$(dd if=/dev/urandom bs=2 count=1 |hexdump -e '2/1 "%02x"') +r1=$(hexdump -vn 5 -e '5/1 "%02x"' /dev/urandom) uci -q batch <<-EOF >/dev/null - set network.globals.ula_prefix=fd$r1:$r2:$r3::/48 + set network.globals.ula_prefix=fd${r1:0:2}:${r1:2:4}:${r1:6:4}::/48 commit network EOF