From patchwork Thu Oct 15 15:12:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Alin_N=C4=83stac?= X-Patchwork-Id: 1382732 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=JL9OcYGU; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=hjqRfUrb; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CBt9m4q4gz9sSf for ; Fri, 16 Oct 2020 02:14:36 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id: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:In-Reply-To:References:List-Owner; bh=7M5G+pgljOGUpGPooExrIao6CqAOatYFzsN62ud/rgw=; b=JL9OcYGUMHTEIb2rYJftoi6UAx GhRNW9euuR7m7NdwUY+uNpYPE8JOZHRyL+wk+AfO2lTab87RrkZnRUIJ0PLIeHcm9GEvS3eA+tvM9 Pj7lfilzcXOkRl6Ew9z/u82PpKx82mFaqRvnz5Xdzcj9f5ZJR8J7zy8sz//+lLS2ZnoKh1qs8voh8 qx1Z84eJXYQQ1H8AetqRvPy0wZcAf0Uy+2frr7MS/3xbrekVTyBEx3aJ24auMduuURFn0XlM2Xmkp Wh1AWXV5VicVh6zbmvc7Kbcdt52wC2W/oFeLyxaiJ5NZxDfnAejqdmRsHX4JKxXG9hVCBqrN1xZcg b8BGK5/g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kT4vW-0008Db-V4; Thu, 15 Oct 2020 15:12:22 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kT4vV-0008DE-Cg for openwrt-devel@lists.openwrt.org; Thu, 15 Oct 2020 15:12:22 +0000 Received: by mail-wr1-x432.google.com with SMTP id b8so3984830wrn.0 for ; Thu, 15 Oct 2020 08:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=wUah/BoGo1hy7A64PMaR/4qAUKabm2VgZueljmX8Tb0=; b=hjqRfUrbI4v9baJoVTT1k5/L4mlh4dXN78cy+8ce46e0AXIzivoVEhfkzv3xSfyS1d YUl+isn5VPDrSlcMUCDsPnMm3QLHaoS+tCpP1KZ8fMyevQAiYYTovCNY+eVWC8jqHg4Y vBRBsc3bVA2kIv7WmFqStMyu5Ic0PM3cPkr65qJ86rZX/PAi1MI8uxIDpPnBd6AbGIUY YIzQ6KGXaqfAD+RO5SIeHIrNDN5RiUyaX4S+uYIr91J+dRmbcBpuW78qOiCOYk+FbGRP VTJjySueBG5MBkV8Ege6UN+pyY9k/eEY3WbO0o57GXPLo8ibBKPIeh+xL8TCmkLtqOn5 FsyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=wUah/BoGo1hy7A64PMaR/4qAUKabm2VgZueljmX8Tb0=; b=Ve1J1MeLYZdMtrvSWQChq98AwtEvtFBKMoipRBqOHbvpuezgDFliPh0/7kEgca35VZ fOSDswut5s+wNwfJJxmfm1cqkc49iZvqG1+xgxVvu16zfHVYk3Awfe3uo3B86gVOcjBS 3zyNLuzDAMYiELaUg/DuXSqgMTr7GN03DKx1ci5bAUMrmjMafdoauM1+ZNe1iHdNOz3/ 7VvIHxyUooQviS4qU/VD7yX42mpfdlb3zprof/Ev8H4vZvtGPZTy2pBmOMvPRvM9v0dS Kl/7WkYBq6pE1v1OkNxQofdgMUKscuXJIQAlXZ1RwaxYaSL51XObED8/QHgVJJvZ3o5u 7Caw== X-Gm-Message-State: AOAM531KSF1TCzpeRaTL2Hf37l2EJ4rlauyrSmh+2LP4W2Y7L/setSNH ekylLlx1DVWvj01aqdtdkjs= X-Google-Smtp-Source: ABdhPJxc4nCETQOKcaJSxDIw3A9sGkSvhwnOxVcslfyTUS9G06prDT0nevibzl3mmLAF6Rdln0ZjVw== X-Received: by 2002:adf:f7c1:: with SMTP id a1mr4968109wrq.399.1602774737035; Thu, 15 Oct 2020 08:12:17 -0700 (PDT) Received: from cplx1037.edegem.eu.thmulti.com ([2001:4158:f012:640:2a10:7bff:fec5:6f08]) by smtp.gmail.com with ESMTPSA id j13sm5166364wru.86.2020.10.15.08.12.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 08:12:16 -0700 (PDT) From: Alin Nastac To: Hans Dedecker , openwrt-devel Subject: [PATCH][odhcp6c] odhcp6c_find_entry: exclude priority from the list of fields that must match Date: Thu, 15 Oct 2020 17:12:15 +0200 Message-Id: <1602774735-8141-1-git-send-email-alin.nastac@gmail.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201015_111221_455342_2AA0861C X-CRM114-Status: GOOD ( 13.77 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:432 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [alin.nastac[at]gmail.com] -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_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 Message has at least one valid DKIM or DK signature X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Priority of an entry can vary from one RA to another, but the entry identity should be the same regardless of the priority declared in the RA message handled in ra_process() at a time. CDRouter for instance tests compliance of the device to requirement G-5 of RFC 7084 by provisioning initially the CPE with a valid default route that has a medium preference after which it sends a low preference RA with lifetime 0 to check that CPE will start sending RAs with lifetime 0 on the LAN side. Because odhcp6c didn't matched the low precedence default router entry with the odhcp6c_entry that was previously stored with medium precedence, it will fail to remove the existing STATE_RA_ROUTE default route, hence preventing odhcpd from advertising RAs with lifetime 0 to LAN. Signed-off-by: Alin Nastac --- src/dhcpv6.c | 4 ++-- src/odhcp6c.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 4cd1abc..65cc4e1 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -1233,8 +1233,8 @@ static unsigned int dhcpv6_parse_ia(void *opt, void *end) // Update address IA dhcpv6_for_each_option(&ia_hdr[1], end, otype, olen, odata) { - struct odhcp6c_entry entry = {IN6ADDR_ANY_INIT, 0, 0, 0, - IN6ADDR_ANY_INIT, 0, 0, 0, 0, 0}; + struct odhcp6c_entry entry = {IN6ADDR_ANY_INIT, 0, 0, + IN6ADDR_ANY_INIT, 0, 0, 0, 0, 0, 0}; entry.iaid = ia_hdr->iaid; diff --git a/src/odhcp6c.h b/src/odhcp6c.h index 40ce098..14d0017 100644 --- a/src/odhcp6c.h +++ b/src/odhcp6c.h @@ -348,8 +348,8 @@ struct odhcp6c_entry { struct in6_addr router; uint8_t auxlen; uint8_t length; - int16_t priority; struct in6_addr target; + int16_t priority; uint32_t valid; uint32_t preferred; uint32_t t1;