Message ID | 20240509223213.97389-10-newtwen+github@gmail.com |
---|---|
State | New |
Headers | show
Return-Path: <openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org> 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=V5srYkG9; 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=hbyi0o1t; 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=L2DAGGeX; 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 4Vb6Jm5jRnz213s for <incoming@patchwork.ozlabs.org>; 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=JE0tafP5pHcsZY8HnpphuTLtsrnTZRU4XyPdvIsKZiE=; b=V5srYkG9KNSyEh 16VFjJeM7MmeMrLnItiu4gijNMGVWbk6k7wiXHr0w9sZxEU18UTRql/l57yjw3utw4MFQokENTmry 9d7yb0+V2mx4ShgkzU+8EWn7RihEd4c1aIFGN5/0RHGnSry2TEqLIfCg7o+DOjLke5gOW3r5Vgr29 juuD8qdiLoz83+IEJschdia8c71cEXCfrm3jQ6WiI8+3w/n9oPdnQ0aVO14dfefpzywKv7UuZq4v1 zDYVrLlO1VFCOBoQOJgt/xmkJr82gKiondjDwoJMyYudGvJwgily5ZV8IyRh4dm1Nfr1ZL7MGWTPi 2qM4xqV08Updtuzs5qmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5CK5-000000037DN-3OR3; Thu, 09 May 2024 22:33:10 +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-000000036vD-1rzp 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=AfmGVRe3R/MBdjGXDbL7nIe+1TH016x3tHInG/BWzto=; b=hbyi0o1tQOAri93dc5WyGEFpwb U1k2H6wo/gj4FWK/5GB6usmH19djrYnCt6ubt6iGM5xgOcnpQ9yzZHwWUBMeHi+u4HD15f/hfA934 6yHlWjXQxb+rIjK0e2k+kKr2e5x3UF26mafjsOdOaxbTNCrfvDAnHB5wCc1fmP2tmsudWQhyNIRyK KQCh7BKOmIWUhpztELJqGLMUKPfIExJe96jbMravEFRJVLehqOX81XDJ2AEHzimjmHN9Wfddul6th 16YzNPpG3d9XHGus26bTT4s/+z7G2U4pCz+vEXEpdiOA7f9v9N8ccQKncNNjs+UZOiGFKLWRPwNWj waTcdpng==; 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-00000001aJl-0Iga for openwrt-devel@lists.openwrt.org; Thu, 09 May 2024 22:32:35 +0000 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2e521817c1fso4925411fa.0 for <openwrt-devel@lists.openwrt.org>; 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=AfmGVRe3R/MBdjGXDbL7nIe+1TH016x3tHInG/BWzto=; b=L2DAGGeX+egtbfvAn9NYkjNw+d07pBn5czZsuKSXlifFFIl1f04OxyokHha//x3G3C dU6Vcj9p0yDxQamqrH1OGm/dAl65yBYcuhvAKAOOnhKMBmKlTIMv3w+JO4Yoo2kTuMR4 Vqm11dhFDuPx+HBnucmnFCvzYj5RZ9xbSQyu/KrTg5bVFs8utx7s5T8x81uuQckPOITn oq+GU0iRGsM5l0Jy0u/IvwWsEtOQiClaWIv6tiHwPZmsdIBSLTXJ6RQspN7RKp4BTUOR gcoVUSwuFn0xenHixNoXEaE6P7tQ59DKD33xRLxuXd635C4thKOGVPLIrukWrKxDd1Bi kSog== 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=AfmGVRe3R/MBdjGXDbL7nIe+1TH016x3tHInG/BWzto=; b=n5bJvi5lG76hRihcfPk7WOwouQ+fqIqnyjEsryWs38cBM3OgrqMxQTOJhPLRMkkj+y C26rElj+Fg6pNuDkktuKimv6AYGLnvsPWJYuCHUSfT2O7GWBKGTUA0nFA7+ihKlQPBVQ 7jCW+EdC7Jkr0iQhv6iE8fJLTbbBGtleL3OCVnY1rB+KsjP20YqZ+gFuE2RcCHLk/Zo6 tPYial6KWmlwpNBnCeleFQN/auf9f2v2DuqzKoaydCAaoqXqgXS2UXPesbevmQfdbKa1 JAcqcSbez78j7QS7nyI0uACThREx3JJN3O+/GcIV2Cc41h1aBPZQc78uITj3b6iIAgdp Pnfg== X-Gm-Message-State: AOJu0Yz2UX2CKzLd2NeofYhKEQIW8GQCXu13NDGgkUgR/KoS9P1z/9C9 n8JCoHa1SlOqmnTVagHmuNdQL3mYAKFis3dxW2WDHxipwp/HE1M3dWADug== X-Google-Smtp-Source: AGHT+IHXPTdEeDFQBijxs43lXwvIC31wKcsLFwpamFNSr+a1sh9ZfCAcp2B5XYYZeyYFqNsTiMFX8w== X-Received: by 2002:a2e:2c13:0:b0:2e1:e8fa:4f56 with SMTP id 38308e7fff4ca-2e52028e665mr4103221fa.42.1715293939322; 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.18 for <openwrt-devel@lists.openwrt.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 15:32:19 -0700 (PDT) From: Paul Donald <newtwen+github@gmail.com> To: OpenWrt Development List <openwrt-devel@lists.openwrt.org> Subject: [RFC PATCH 09/14] config: clamp ra_reachabletime to RFC maximum (instead of complaining) Date: Fri, 10 May 2024 00:30:41 +0200 Message-ID: <20240509223213.97389-10-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_260260_9D8BFD69 X-CRM114-Status: GOOD ( 11.19 ) 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:22a 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 <openwrt-devel.lists.openwrt.org> List-Unsubscribe: <https://lists.openwrt.org/mailman/options/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=unsubscribe> List-Archive: <http://lists.openwrt.org/pipermail/openwrt-devel/> List-Post: <mailto:openwrt-devel@lists.openwrt.org> List-Help: <mailto:openwrt-devel-request@lists.openwrt.org?subject=help> List-Subscribe: <https://lists.openwrt.org/mailman/listinfo/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "openwrt-devel" <openwrt-devel-bounces@lists.openwrt.org> Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org |
Series |
odhcpd config value clamping
|
expand
|
diff --git a/src/config.c b/src/config.c index 6b3cb01..54fb9b5 100644 --- a/src/config.c +++ b/src/config.c @@ -939,11 +939,13 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr if ((c = tb[IFACE_ATTR_RA_REACHABLETIME])) { uint32_t ra_reachabletime = blobmsg_get_u32(c); - if (ra_reachabletime <= 3600000) - iface->ra_reachabletime = ra_reachabletime; - else - syslog(LOG_ERR, "Invalid %s value configured for interface '%s'", - iface_attrs[IFACE_ATTR_RA_REACHABLETIME].name, iface->name); + /* rfc4861#section-6.2.1 : AdvReachableTime : + * MUST be no greater than 3,600,000 msec + */ + iface->ra_reachabletime = (ra_reachabletime <= 3600000)? ra_reachabletime : 3600000; + if(ra_reachabletime > 3600000) + syslog(LOG_INFO, "Clamped invalid %s value configured for interface '%s' to %d", + iface_attrs[IFACE_ATTR_RA_REACHABLETIME].name, iface->name, iface->ra_reachabletime); } if ((c = tb[IFACE_ATTR_RA_RETRANSTIME])) {