From patchwork Thu May 9 22:30:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Donald X-Patchwork-Id: 1933687 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=4CiooVWD; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=L/rnctP4; 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=A+KScD+v; 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 4Vb7xS2J8Bz20fc for ; Fri, 10 May 2024 09:48:11 +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=/I+NI6gpe3MuqWoc3sIA4ScW0AAqCnTbgENEGW1UU+k=; b=4CiooVWDpYV8Ip vvTgCT23yo/jLIL5xeazl64ojk4rOc6KGnjoiZvETaI+2hFbuYl5AmjxwGoxpnHCGqALCMfqOfVGg SDchSWt5AFZSH0de/pnK1qhzkxpRXHaKCxqDJWOUVXott7+CKnlEhRkZJacA2hx3EQAXI8eXsX/6I v9ZtcEL5BbvO4lNtqj+jN2958gy5UqEVKGAXHltHC1cQnNcYju0FfZPG+omLWoK4hOuVgJKJOPVQY 0JYyXrFX8Hr+jDRXa0HH/2JAcXkZj+xB4Nnjog+TAcz/Qh792DsZzZZ+zoNv65V7N6DbRV368phh8 /lLJEPdc8zaK6Bz47YiA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5DTI-00000003IxD-1BmN; Thu, 09 May 2024 23:46:44 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5CJV-000000036sy-1bId for openwrt-devel@bombadil.infradead.org; Thu, 09 May 2024 22:32:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description; bh=r69MFA3Gc/QVFtBSPV45hekmoQJarL3vYkRsRs3pmXk=; b=L/rnctP4ti8hq//TS3FbQguz/V ZsnFiEC8FZYlRXIhLNVb7lQwjb9Hlq9SjDvnIRfTtAsOF3D5QWSkaPkxI8WHmlRIIk2eAABL10o5W 7bAwNSMrgEKzbubQ+3a+gkzJ+K4VD8ILhym9yqe6rqZlpL7qe/in7unliM/MxywYiIsQHRU6y/6+g Kqt8ycDto3yroi/D9ikljMgd1omhE1Asq1NaCDz4O9RINzhsPrYdwBDq+vVp2/IB2i48HWf1REb5J Fu+BJf69WLJvphXToNaaEuWuU4wd+3UGbBoDtGlq1YiLTXyMA3pusblF93Bp4CP+b2qZUr1XZ2p8x M13LfIRw==; Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by casper.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5CJQ-00000001aJr-1oZh for openwrt-devel@lists.openwrt.org; Thu, 09 May 2024 22:32:31 +0000 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2df848f9325so16326461fa.1 for ; Thu, 09 May 2024 15:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715293941; x=1715898741; 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=r69MFA3Gc/QVFtBSPV45hekmoQJarL3vYkRsRs3pmXk=; b=A+KScD+vbaUHuTSufmdIKVN0srySb+Y2V/mh6ScbldBq35airHJ7DYRY+b0AtkGq+s FtDOazS1MuYcHmlb0LHrs8ZNr/uVcHLd7qMpKMA1a64QqGIYwDyL6Iwq97RilW2rQmWE Kd2UfTCak9ewZravSXfUkMPFtBMzYVUHsO/BtUJdA31CutdlOwuDbbA6qTfQTAms0/GE Cnf+vOklJMbRmkEK8PH5c7V9fdcQHiviNT0QPPTCuwTOEXA7BYVSRiEul0ayHNxqiSGL /pS5hVE8tjPLVt4S69HRmRbyoapuCgh+VJICBlTfzuG/F7ZscOgbP2Uu0t9O0MdRcKI3 aZ8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715293941; x=1715898741; 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=r69MFA3Gc/QVFtBSPV45hekmoQJarL3vYkRsRs3pmXk=; b=CrXDqHKAJIXJHqeaircQBHPPoCkSwF/gtLRvU9bhG1jiwAA5ELPMiKDlSkh0lOWk2H bVpxkRd+wj2XT+vdSGxaX4l2wGEAKdg9N3yU0OHg5GevOXwhDXbwpoBktF8iQ4Rc1HHN upZB9zA98Tjx8kka425vTZwA8dtC6V859tLB86j5043RXtuwkIH7DL7CypyGb9x9rQE+ xjavmN1gTBOjQAGlJ3f3ioyB5VHnffONVbAYctHvvM8NgNGT/LOVVlCyFJ72/Bxw8+kO 4MDC44NBtMnSUzKIEDA9KteMkgmoY8c1GlN9pASmwuA2D7oJjKH8ZTwpR+VtiNRy82+9 gAXA== X-Gm-Message-State: AOJu0YzZC3e7cV8A4tdolSPX8sLj4sycWfoX0gbnA3y/xbxJhqp5pAf/ nTxKxD0gVsYnHl/TG4+TZOakkberdrTCsAxGMYoiFoqfpkpgCUXfjNTACA== X-Google-Smtp-Source: AGHT+IFqXP3wRD831lrJdTdr5Aldyn4tb6od/v4DzNv4n0WhsUjb5DeS+TycgFQPRwpwIiH3Ol0Xig== X-Received: by 2002:a2e:6812:0:b0:2df:49b:27f1 with SMTP id 38308e7fff4ca-2e51fd2e03emr4173941fa.4.1715293941434; Thu, 09 May 2024 15:32:21 -0700 (PDT) Received: from blackhol3 ([2001:9b0:40::cae3:cb03]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2e4d0bbc3a6sm3156191fa.13.2024.05.09.15.32.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 15:32:21 -0700 (PDT) From: Paul Donald To: OpenWrt Development List Subject: [RFC PATCH 14/14] config: clamp dhcpv6_pd_min_len Date: Fri, 10 May 2024 00:30:46 +0200 Message-ID: <20240509223213.97389-15-newtwen+github@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240509223213.97389-1-newtwen+github@gmail.com> References: <20240509223213.97389-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-20240509_233228_594816_739F6E39 X-CRM114-Status: GOOD ( 11.83 ) X-Spam-Score: -2.1 (--) X-Spam-Report: SpamAssassin version 4.0.0 on casper.infradead.org summary: Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:234 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -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_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 -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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 From: Paul Donald Attempt to be helpful. Signed-off-by: Paul Donald --- src/config.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/config.c b/src/config.c index 4d35548..7484519 100644 --- a/src/config.c +++ b/src/config.c @@ -883,11 +883,11 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr if ((c = tb[IFACE_ATTR_DHCPV6_PD_MIN_LEN])) { uint32_t pd_min_len = blobmsg_get_u32(c); - if (pd_min_len != 0 && pd_min_len <= PD_MIN_LEN_MAX) - iface->dhcpv6_pd_min_len = pd_min_len; - else - syslog(LOG_ERR, "Invalid %s value configured for interface '%s'", - iface_attrs[IFACE_ATTR_DHCPV6_PD_MIN_LEN].name, iface->name); + + iface->dhcpv6_pd_min_len = (pd_min_len >= PD_MIN_LEN_MAX) ? PD_MIN_LEN_MAX : pd_min_len; + if (pd_min_len >= PD_MIN_LEN_MAX) + syslog(LOG_INFO, "Clamped invalid %s value configured for interface '%s' to %d", + iface_attrs[IFACE_ATTR_DHCPV6_PD_MIN_LEN].name, iface->name, iface->dhcpv6_pd_min_len); } if ((c = tb[IFACE_ATTR_DHCPV6_NA]))