From patchwork Fri Apr 5 00:53:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Donald X-Patchwork-Id: 1920020 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=wYBUsEJC; 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=BQCOUkDj; 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 4V9g7S4sZ2z1yYf for ; Fri, 5 Apr 2024 11:57:24 +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: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=Iyicr5qjrdLSvJtUwA0+of2dmG1nxp2rP1H+sVbQOpE=; b=wYBUsEJCTtYfPy IkDZzT3OIpu7/5oyL0GEBbZrao4uqbZGrw4kSVt/wxizel3mMBthlcgyJGGchtC9dRrsqySiHGcK/ 1+t9Mon9N4b7wbzN8pLWtvUfa/hm/URqBHyP0e1sA6o/kpqC1/+NXpY26N/jEr9EEeaL5C1g13jzq QnLhjGAV6ucyK2aBxByx6jgM3RSDs320KQQ7k1ymvqZQBYCCnqw+nGkWRcgEbUSM8/Wo1CZJQ8UPN rICEyZumLA2boAIez01ZRAGqZRrKq6+fGszuKnqV10iXYpppqBMKEpM24qtA7iYLwXbmxFRwgNpTi dt1+JuzVdAGpe2C7HLPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rsXra-00000004kHx-1rEv; Fri, 05 Apr 2024 00:55:26 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rsXrQ-00000004kDC-3oIE for openwrt-devel@lists.openwrt.org; Fri, 05 Apr 2024 00:55:19 +0000 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-516c97ddcd1so1827832e87.2 for ; Thu, 04 Apr 2024 17:55:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712278514; x=1712883314; 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=/fYFrCp2t9IIKC+PbMX7h8TE2s3K19KXAyP+0Z9q0gY=; b=BQCOUkDjcvoVfTCsLG9+TiXnFEujwK/2txGTUFwSYsgT2HzE9drpQudUVBcbPT3sD8 e9cszhVkyA/nKRrUNDinQpsztZojsY8e4aIc+/2oWi87sssr4A4r/aAgHMov0OzNDBiv E6GtIEQHzHQ8sXiC3LrGPSBZ3EZssMZOIPjvWuLw6cA/3dEIApMcbJWhwRc9UVFAwVFJ 34+rc0ucp0vLX0/I2SgpV4oGyvcNEiT/gB9JN4oXCoG1gLbdkwJJWrU6MMBvoQzKJXLv jJAcN9n5vf7C4zgLM18n0uYWl3v1iwDjeJaOwnRm4M5vSviirn1lV+WbDw7x4/IOqz9+ 0WuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712278514; x=1712883314; 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=/fYFrCp2t9IIKC+PbMX7h8TE2s3K19KXAyP+0Z9q0gY=; b=sH5tAwOxsCKdkQ32BUSuewHSsZ5fxAF1bPtejUc7tj1eKiqZtLMvGIrRbssyyBbf5A hY64+ofZNDYMNEzQAo4hUBLRPxLaCHRHTcEbDtzsmMI+k/AVFh1Zsz3uCOmq/2I4vSo/ F7DRmAYHKzy4t19j5e5/nHMUEFaB+UgQf8RRCYoOUFPSFCEAgv7EZwL/H8O4SxK65FtT CN+nk7u4gefESoKmSJfvZBlQpoPzHXMpnXRUWXipuBR782nbwskrs7qPKZPBEGvBNlbz C/UGmUrqR3GDonSJv0mJ09bsTPKVIoXeq20Jg1g74AgYwWb6wJg+WnOah9NxCMjTWm6P eIoQ== X-Gm-Message-State: AOJu0Yx/v10Qkid7Duy82I7V6NPO7z/cu/AUA5Q3a1/pMtePJzWMMyWg 89BXWTqO2phyh8lRXKJFao1WNxfiPw+wSTgkMui0prvGRMR11M95TmOh+0Ykn9s= X-Google-Smtp-Source: AGHT+IE8H8e4e0eLn01rQd8lf9vg9XTO8oeeSPVUdJlXCLeX/bM7UJ00P+nunu48Jv/1KRFGbdwnUA== X-Received: by 2002:a05:6512:3da7:b0:516:cdb2:6198 with SMTP id k39-20020a0565123da700b00516cdb26198mr2796561lfv.18.1712278514060; Thu, 04 Apr 2024 17:55:14 -0700 (PDT) Received: from blackhol3 ([2001:9b0:40::cae3:cb03]) by smtp.gmail.com with ESMTPSA id a1-20020ac25201000000b00516c1bddfecsm46630lfl.182.2024.04.04.17.55.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 17:55:13 -0700 (PDT) From: Paul Donald To: OpenWrt Development List Subject: [PATCH 4/9] router: inherit user-assigned preferred_lifetime Date: Fri, 5 Apr 2024 02:53:07 +0200 Message-ID: <20240405005510.19778-5-newtwen+github@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240405005510.19778-1-newtwen+github@gmail.com> References: <20240405005510.19778-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-20240404_175516_976166_B68687C9 X-CRM114-Status: GOOD ( 11.58 ) 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: From: Paul Donald Inherit preferred_lifetime value irrespective of whether ra_useleasetime is set or not. User-provided values for preferred_lifetime are now assigned, instead of ignored. 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:133 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_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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.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 Inherit preferred_lifetime value irrespective of whether ra_useleasetime is set or not. User-provided values for preferred_lifetime are now assigned, instead of ignored. Signed-off-by: Paul Donald --- src/router.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/router.c b/src/router.c index 335218f..3890c0b 100644 --- a/src/router.c +++ b/src/router.c @@ -590,9 +590,10 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr if (addr->preferred_lt > (uint32_t)now) { preferred_lt = TIME_LEFT(addr->preferred_lt, now); - if (iface->ra_useleasetime && - preferred_lt > iface->preferred_lifetime) + if (preferred_lt > iface->preferred_lifetime) { + // set to possibly user mandated preferred_lt preferred_lt = iface->preferred_lifetime; + } } if (addr->valid_lt > (uint32_t)now) {