From patchwork Thu May 9 22:30:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Donald X-Patchwork-Id: 1933668 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=JHK8+Nv0; 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=gXVVb89A; 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=Qr8PAPF5; 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 4Vb6Jm5r51z214f for ; Fri, 10 May 2024 08:34:47 +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=i3p1Pasr0GORexrOGcvPNxqu1z9lle7P6uCc3EHQbL0=; b=JHK8+Nv0m49ydy pvyFCJVcSpVa5OD87ATs1+RlbgTK5/Xg7tyYG0/z+KNepQSCfYcr1vLoUAJPuSxK3boN0ltP/byp9 FFfU4FhX8hykEjhyLq940wC2/yZ0lj7UoJe9l854McWxj2+R/1fHhIN7ArR3+h3uPSijhEuncxK9M mBK0U4xYgL8kGkQEN0gnovLk89WqjLL5VjX5EoncNMN4WSL3xRU/Q65bmwSrcZ+P1/trLojQU9oKo IXJyPml+pUohTGrmfyOt0Hh2xOlBoT0FUjPaG0zlv/L0fZyyfC8xOoEKnfv0R4xKqjeHA83aROmAM kf+Ii7/IF+5DaH9m2CWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5CKK-000000037PI-3s1q; Thu, 09 May 2024 22:33:24 +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 1s5CJY-000000036vh-32Jl for openwrt-devel@bombadil.infradead.org; Thu, 09 May 2024 22:32:36 +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=5zUWPezWduhtOWPJwO5ZFNp9TGPKZEPOZ6fcFT9Pgko=; b=gXVVb89AaQGmIKvmL9Uh1ZiC/U NKY7Vk4NK9cj0AeAbgoHbxMCHnueuOC4DLitDBO+U4pi6CsCD1aLMXf2KDzfgb9e6v7Hw2pRKhJA1 yWY0gKxtE8Zf4+fFFkMvsS9Wn3mIki5vub9tSMcy9aRygpKIL4F2CSJqDI8AO+zdhJSB+91Mt5hD3 h85ck9TFAXdxreJCZl2Wz4H4z1NK+g7HIJb2F23ItLUTIoY2A+AOE39UqNxybuneK6i6e/nKDQnWe vukKdvm03tkJ4J4wdoHtXd81yj+by9qPyTp0CB2DZKFXrX6rkNd1UCnV5vEt3fY+st7a5KiVwLMLY cMMJ5hUQ==; Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by casper.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5CJR-00000001aJk-0Ila for openwrt-devel@lists.openwrt.org; Thu, 09 May 2024 22:32:35 +0000 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2dfb4ea2bbfso14982621fa.2 for ; Thu, 09 May 2024 15:32:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715293939; x=1715898739; 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=5zUWPezWduhtOWPJwO5ZFNp9TGPKZEPOZ6fcFT9Pgko=; b=Qr8PAPF5zlvlYPkSIHrty9Ju3jRH/I2MaN+I+Dx6h29LgtwEQMkTEW+BGrFAHlz1OT VFwURdqivz8ovvy6VRW8DZoWB0urBMWnZXqKH8nKLkpKpSc/wQLO/qkvxiqz/3INBfeu DBFJk4xeTLBPZ1LNzk5vI+ykuCl+N1YFvKk3rU79FfZeqOM3BZELmrZoh93ve2JvTqL4 D/olldbs15tooLWMj1SLpoToP1Fm53Jb0fLHxAaShnjGrZoAQDHrgePjARAvfCGZ9Gjt 8rY9kIyD81JFE9h1kuqj+0Nz7LWoa5sen/L7T9HtvPUtM0DQmEARPUhwosfbY13H22In rzIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715293939; x=1715898739; 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=5zUWPezWduhtOWPJwO5ZFNp9TGPKZEPOZ6fcFT9Pgko=; b=ueEo0PkpXHCuXlZBG/0Ckv99QUvcYhglAq5N5TNjbDWZyxi18XUfncSCyEc7WWUMeQ jcA/zsPfEUOqhWy+r+ZG9vURutXHH69CeF1Sg+1Z1ZuRGvoWvjEeEnZfmc1Esdv7F3Y2 8JC0w9qntY8zwTxjyqaHFhQEdiW/lfpPGED6BSIlrGAt0ORmW6IsHjHltA6XBFq4zQcu E9vDzAzn/pypa7hw4qgwK4GD1zd8Gv+W8fM/PsVRT7rSj10XfewRBkUD2AFwmPUXDKlW G9Bhai5BvnyaRixuAFMMMeLEvV+vIGEBL5l0R3Yf25NMjcSSVRs5D1wqOX0eN3fe71sk jFPA== X-Gm-Message-State: AOJu0YwJB/8tv/XDLdfE4aOJtmaf6O3cGVDrvUgRPbBO1GpuoU7xK2bB fvh5ThPwNOKt1Z0M9zmMxxFyqau4mizJ7/QfuCVjAxUCyyaJKFCIBpZ+vQ== X-Google-Smtp-Source: AGHT+IEemiW33Dfsd9/RbkhAg/JVxIZGSGGPzV1puuj2yMSNUS2mgMCh9m4ZBzKXKTUUDS+nn/wJ0Q== X-Received: by 2002:a2e:bc0c:0:b0:2dc:d7a6:1e53 with SMTP id 38308e7fff4ca-2e51ff5d20bmr4479171fa.18.1715293938856; Thu, 09 May 2024 15:32:18 -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.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 15:32:18 -0700 (PDT) From: Paul Donald To: OpenWrt Development List Subject: [RFC PATCH 08/14] router: clamp prefix valid_lt to interface valid_lifetime Date: Fri, 10 May 2024 00:30:40 +0200 Message-ID: <20240509223213.97389-9-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_233229_256036_D02BF973 X-CRM114-Status: GOOD ( 11.51 ) 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 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] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:233 listed in] [list.dnswl.org] 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 Before: == ICMPv6 Option (Prefix information : fd26:3c30:a222::/64) Type: Prefix information (3) Length: 4 (32 bytes) Prefix Length: 64 Flag: 0xc0, On-link flag(L), Autonomous address-configuration flag(A) Valid Lifetime: Infinity (4294967295) Preferred Lifetime: Infinity (4294967295) Reserved Prefix: fd26:3c30:a222:: ==After (valid_lifetime set to 6 hours):== ICMPv6 Option (Prefix information : fd26:3c30:a222::/64) Type: Prefix information (3) Length: 4 (32 bytes) Prefix Length: 64 Flag: 0xc0, On-link flag(L), Autonomous address-configuration flag(A) Valid Lifetime: 21600 (6 hours) Preferred Lifetime: 21600 (6 hours) Reserved Prefix: fd26:3c30:a222:: == Signed-off-by: Paul Donald --- src/router.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/router.c b/src/router.c index b859c46..00752af 100644 --- a/src/router.c +++ b/src/router.c @@ -600,6 +600,13 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr if (iface->ra_useleasetime && valid_lt > iface->dhcp_leasetime) valid_lt = iface->dhcp_leasetime; + + /* currently the only way to control ULA valid_lifetime */ + if (valid_lt > iface->valid_lifetime) { + // set to possibly user mandated valid_lifetime + valid_lt = iface->valid_lifetime; + } + } if (preferred_lt > valid_lt) {