From patchwork Thu May 9 22:30:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Donald X-Patchwork-Id: 1933672 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=cQeVa4q8; 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=PASNfIyg; 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=Kdim96im; 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 4Vb6Jz0zHLz20fc for ; Fri, 10 May 2024 08:34:59 +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=RgnOHe1eNduM8rXtshFxY3YdSoePNUn78EoaBlDS1ig=; b=cQeVa4q8lAtpSr t7koPverdVlJjO0U/inZt/BnfFl2fGP6/jhRKmV2AGYUeynpNwDSd44z2h2ONS6tONe2PSZM68ot/ CGWYZ0BF5dsv4E3fzdzDJbOW4DJkXqGwF/YyyI8fgTVORrMaUL6TLo1pEY+S90HYONzT/QyHydosx zsc9BQf4YcUijPyLJAdVvNfM0IJsx6zGc8uxCrFBIUfxbMOxVS8hrLwU2pwbHOFBl5OD3NUG4LPH3 kVXbRj3xr7hDCgL1Wd6G64Sm3uTzJWCpP0lRd1e+OBk9e8BprAXxzeAJZ78q9DFcjPfDDJFIHl9oN 2L3GexQuskYfI8acJbhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5CKm-000000037j9-1Bts; Thu, 09 May 2024 22:33:52 +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 1s5CJZ-000000036wS-2o4x for openwrt-devel@bombadil.infradead.org; Thu, 09 May 2024 22:32:37 +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=92ez/3ApKqiMqFdP5TmhIRcqj8LOACO4tRVUcWtio4Q=; b=PASNfIyg+eyBd4r6UVp+Pgod9D 4+70sZs74OnMc89MzNmzaLW+cLzYuDrBOQbyahUPcNIiYARuqQdxUOJCOdxQee7oQ/DE+nOLHnkeL ceTN7Qi/Mp5VGy+Vmg289HDOQATqQ6GvQ2Y/8pUfn286/2Ri8YV+tsmU/1U6LcpU9fP8EKBvpIaQl Y3sy7Q+xMtMu0Z3XhlEblsXkev2YId/NdbNOJdVrOUViT/FG0fMagW9ChERNyHaA3v1m+OWLGIM/6 fVtMIZpREc2w3f/v37Mh+0TyEN0XDUcKOmOtQAf7dNSKVXCsrEd+sZ3Us25Xo3m42UkSaJRgwshs8 r9dzi0EQ==; Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by casper.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5CJR-00000001aJm-0J4v for openwrt-devel@lists.openwrt.org; Thu, 09 May 2024 22:32:36 +0000 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2e2c70f0c97so17442321fa.0 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=1715293940; x=1715898740; 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=92ez/3ApKqiMqFdP5TmhIRcqj8LOACO4tRVUcWtio4Q=; b=Kdim96imcEd6NIFN8huDL6y3MIJ30x7+8WEqTrAdd/83tNAdeAR0sLSTG8+X6NNAtr 7HEcRWGvIEozDKD52PhvrJ4woqsL/aK3ulIzZmuwt6phW6p54dIzj7xS98HmxYjhf2IE 33dErTHegLMY/zN5ibWTJIs4xYlip7iDFDSYCL6N93l7lv8utxTaHnNdEFjEPf3hTcZR 76ym1OyTKMP8U9oUE4bogYguS8CoqXmkOmvnIhXK4OM9XKiPGLFN5GpeRq3ln8zAgVnw jsToM/nzevJLXELGVh8yrLRGS4VJHOymCUJG1UlyYvIgJsa85Pak69dENyKOY5QWKLq9 ZbhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715293940; x=1715898740; 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=92ez/3ApKqiMqFdP5TmhIRcqj8LOACO4tRVUcWtio4Q=; b=lhWB79PvJ84PWb54tySj9dfJzcIIaIWBlKW/I85GbTv6WM0aSDE96zE5NuWpGXNotn qULV1D9R3Rq/as5M1iwddPDgaWmcPDp7piTrJFH94ZX+UsirwY03UEmCXjhyhoXR6TQ6 3H4Oq6SZO9u/1csHMunt3PKve5iV7BD/Mjkrl7Nigg3nIOdGCk5AIYz+Zfl47RUI+7Eu awt2+hBvHNQ4HEVqdvD3x/bZZkeg+1ERgcZmXT5Up+aR6aXj1SxYMjieMU/TGM1jvDTz lYxRXnWbAnMFwlYyOg+fdWlVjJPJ8Lkf9aXPZLC4UoTplIfmLuBB2ad8wEN/OQbz+R3x hDJA== X-Gm-Message-State: AOJu0YwbQu0VkEzFEIcCvbSb2pGnM3ply9NLssnRlFaT4/wH5CEIrCI6 mIe9Z+ybx8LRhb6Bp/Z5AerLk4Ouku6PCJwQnLZn4SlCJVDJ04Cs4hY5FQ== X-Google-Smtp-Source: AGHT+IEeC1hZqGkIgRUgFoVA/pJlqEp3P1gZYfgcoKB+sdWnbwXM1kSQZfQ6qLXyt2aZMuLuAsbtEA== X-Received: by 2002:a2e:a683:0:b0:2e2:7e28:602e with SMTP id 38308e7fff4ca-2e51fe5257fmr3641011fa.9.1715293939724; Thu, 09 May 2024 15:32:19 -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.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 15:32:19 -0700 (PDT) From: Paul Donald To: OpenWrt Development List Subject: [RFC PATCH 10/14] config: clamp ra_hoplimit to maximum (instead of complaining) Date: Fri, 10 May 2024 00:30:42 +0200 Message-ID: <20240509223213.97389-11-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_284388_1469931B X-CRM114-Status: GOOD ( 12.24 ) 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 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:22a listed in] [list.dnswl.org] 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] 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 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/config.c b/src/config.c index 54fb9b5..e0f2d80 100644 --- a/src/config.c +++ b/src/config.c @@ -961,11 +961,12 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr if ((c = tb[IFACE_ATTR_RA_HOPLIMIT])) { uint32_t ra_hoplimit = blobmsg_get_u32(c); - if (ra_hoplimit <= 255) - iface->ra_hoplimit = ra_hoplimit; - else - syslog(LOG_ERR, "Invalid %s value configured for interface '%s'", - iface_attrs[IFACE_ATTR_RA_HOPLIMIT].name, iface->name); + /* rfc4861#section-6.2.1 : AdvCurHopLimit */ + iface->ra_hoplimit = (ra_hoplimit <= 255)? ra_hoplimit : 255; + if(ra_hoplimit > 255) + syslog(LOG_INFO, "Clamped invalid %s value configured for interface '%s' to %d", + iface_attrs[IFACE_ATTR_RA_HOPLIMIT].name, iface->name, iface->ra_hoplimit); + } if ((c = tb[IFACE_ATTR_RA_MTU])) {