From patchwork Thu May 9 22:30:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Donald X-Patchwork-Id: 1933673 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=zGBYCJBS; 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=a7lZ6hK3; 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=RZmzgElp; 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 4Vb6KL31b9z20fh for ; Fri, 10 May 2024 08:35:18 +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-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-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6xCTBJmfQ8x75oFkeg/tpDwQF7spIYBkDncTY3fntc0=; b=zGBYCJBSSp1I7rPIlPPaSasj/r n23NHDO+sPaRhcv77Nf7/FPRh1vPe3QnQ/WR5EA/tEGmAOAqRFXz/+Zqxa8QrgQ6y3Cp6XLC8WL0T Y74IUfd5dyeFNL8aX+uSb5hlgHAJ7hBqfU5mGKC4L2Ax5gRnyvdaYf+ZDa5HZz3vKBs95ViNnCcIm 69k3jXa48Z3nxpxLYZwX+7TraP/sWaJ2raiMLbMpRc4sIVehKQJ5kXjE9hIPU6s4jl4yVS8Dwg/Cm Mz508CaJOhnCRmR+vU42DnuxQ3fOqQGRr1rIKCUsmGbfH4DZ5zk9fs68D81TTbZ/XTJS12yPMDssR SY+nxavg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5CKB-000000037HM-3xDp; Thu, 09 May 2024 22:33:15 +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-000000036v5-0dN2 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:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description; bh=kAlChu7qrixtOfbZAKh+/5U0flrpg3ISmtEN5paw4QI=; b=a7lZ6hK3w3YcSJvvRg5BEQVegf TxREpcPJjJcteScfDyhCoeikQoYgC7jl63XEC4jsU2XhS6XWMFCpdwSYPqzpHa9IxjPjBvVuottI3 6gFrs1tNSqN4+anSo2qF9O+3T41KcooYr7wGAnSFeEDW6fAXCd9XI+qRsLaF4eKqpUXAmIXrfLa+T hVOSpqhF1Al5l7Os6Q6kOJ2YuU5lSFnYrIaya/70YWpdP7MiT1f8qC3LqU21AtqQqxAtSYMzYXl7I pCgt68PqFPzNNSVwGGwp1HbFLa6qQChgP7XAPA4Yj14QURWY77DMrbchioDMEcgrx/1Ve2p1SzQA8 /oIDxOrw==; Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by casper.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5CJR-00000001aJZ-0J9c for openwrt-devel@lists.openwrt.org; Thu, 09 May 2024 22:32:34 +0000 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2e521817c1fso4924911fa.0 for ; Thu, 09 May 2024 15:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715293936; x=1715898736; 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=kAlChu7qrixtOfbZAKh+/5U0flrpg3ISmtEN5paw4QI=; b=RZmzgElpJcWBOUC2xlzIQEsm65UmFXCqF1TqNekTS7p1nlpd8rxMvmrJG6tBq4wzTW DYW6nVSQY4NCAEn7NZl/uP1KMPA8w8M+WdS3ogqgZMsuHO0KE+kuc1DWl7eihGUKcWtS Uiv1Z4h8rildpU25GPRXAIAwtQoC4qmven6o/hYlrdosT+ZP3FSY8T+c57RAHuNclJMB NKrxee4dA73c5ThigM+Vj83JQaeivwPhT14i+jRz9nMAoANYhWygWlHl1YvcCHeSHhr2 6pUYZGVUPg6rUbYHhVsOszl1kwG/53gW32D/fdf/kvWNaXhKai/1MU9ew2RemMXce6Ji d+9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715293936; x=1715898736; 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=kAlChu7qrixtOfbZAKh+/5U0flrpg3ISmtEN5paw4QI=; b=vdp8tawwB2xQBMsYOL7vwZr4j5xZGbZlfOAV+QzhVTJ2YHJ4uytAZiR5G6/b+YT1hX /AiIxM2HsXzIpSqqd+QUugaDDxAr0jtTKd/h3lTrzz+QOEOdLE+IhxLLf07XB0g3cJEn BV0f08zv4nn9S/5FnL+9/R3Du/j7n5FHL+KiKSjBJQEjKRs81B3Jbw06iZ7U2nXkk+XY COTmpBR3lI/zGQmHBNH6IwAYV2RE5znD7sLB7PgyLUKLsI6FPh7PZIRgs0kSYg/eGUme P1E8TUEKfx8Yj+Oo9wOaz/19LEuAS6iz7+BHLAavkxBKjfUOnImRMDrmHP4GGHQJEjCP AgkQ== X-Gm-Message-State: AOJu0YwTEFO7j7V/LnpE1OL1QT4dXF28ZRTu7GvYbLR/kWS5IDwl90rw nbHznMYlVXcJt//DT2CJAT778MoyoP7EebkkzPOQ6r0ok5V+NU+Oc1OEkg== X-Google-Smtp-Source: AGHT+IF400bgLpMdnMEa/i+sQxivZlaDE6YYR8zd+ogtK0htD/acHBUibZGrJ6LCDa1XCi19LTYwQg== X-Received: by 2002:a2e:e02:0:b0:2d4:54f2:c409 with SMTP id 38308e7fff4ca-2e52028d78emr4018621fa.38.1715293936199; Thu, 09 May 2024 15:32:16 -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.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 15:32:15 -0700 (PDT) From: Paul Donald To: OpenWrt Development List Subject: [RFC PATCH 02/14] router: Apply updated values from RFC8319 (updates RFC4861) to RA/ND Date: Fri, 10 May 2024 00:30:34 +0200 Message-ID: <20240509223213.97389-3-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_226256_8D37C5F1 X-CRM114-Status: GOOD ( 12.76 ) 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:22e 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 https://www.rfc-editor.org/rfc/rfc8319#section-4 Signed-off-by: Paul Donald --- src/router.c | 6 ++++-- src/router.h | 23 ++++++++++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/router.c b/src/router.c index 7f5658b..ae0c545 100644 --- a/src/router.c +++ b/src/router.c @@ -382,8 +382,10 @@ static uint32_t calc_ra_lifetime(struct interface *iface, uint32_t maxival) lifetime = iface->ra_lifetime; if (lifetime > 0 && lifetime < maxival) lifetime = maxival; - else if (lifetime > 9000) - lifetime = 9000; + /* // RouterLifetime is a 16 bit packet field: skip this check + else if (lifetime > RouterLifetime_MAX) + lifetime = RouterLifetime_MAX; + */ } return lifetime; diff --git a/src/router.h b/src/router.h index 0444da8..1f8d156 100644 --- a/src/router.h +++ b/src/router.h @@ -32,8 +32,29 @@ struct icmpv6_opt { #define MaxInitialRtrAdvInterval 16 #define MaxInitialRtAdvs 3 -#define MaxRtrAdvInterval 1800 +/* RFC8319 §4 + This document updates §4.2 and 6.2.1 of [RFC4861] to change + the following router configuration variables. + + In §6.2.1, inside the paragraph that defines + MaxRtrAdvInterval, change 1800 to 65535 seconds. + + In §6.2.1, inside the paragraph that defines + AdvDefaultLifetime, change 9000 to 65535 seconds. +*/ +#define MaxRtrAdvInterval_CEILING 65535 #define MinRtrAdvInterval 3 +#define AdvDefaultLifetime_CEILING 65535 +/* RFC8319 §4 + This document updates §4.2 and 6.2.1 of [RFC4861] to change + the following router configuration variables. + + In §4.2, inside the paragraph that defines Router Lifetime, + change 9000 to 65535 seconds. + + Note: this is 16 bit Router Lifetime field in RA packets +*/ +#define RouterLifetime_MAX 65535 #define ND_RA_FLAG_PROXY 0x4 #define ND_RA_PREF_HIGH (1 << 3)