Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp138269rwi; Sun, 9 Oct 2022 20:16:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4RoBajQLo3yLNvP2rM21utZ+91CwsrgpFh1B4W2LAcaya4+ODtyrdzhojWWPNhYxFCusOB X-Received: by 2002:a17:90b:224a:b0:203:d20:b92b with SMTP id hk10-20020a17090b224a00b002030d20b92bmr18114172pjb.17.1665371796480; Sun, 09 Oct 2022 20:16:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665371796; cv=none; d=google.com; s=arc-20160816; b=LYxPWtOn60pabMw41PHWjICQbxSqj2Kf2GxNF8LwawzltfnvwIpC4KW/VcZKHCJspn T1/glYgCGD31fAN5pt3GiHULnjhNNjD+SeVXQS9DfI5edDN6UiPkkfi9JK9dQRM9kcPD s0GwelzGY+sZN01AJNsw+fmzrh0SfIsNyLIY/Kmyt72g/84jn3tYOrhHpPRmo4qYK+aD LSi22VAjGNkd9eL613iqCbwSASEsXURiE+UUvDlA88oAI9QKOHnMbfUgoszUkiHuVGBk e6JBkjvJvVXUYAKzD1M9iXXB1HyVRqyoeSkD7dejtbpDTEmYD+xQsYrl77wCSi23yYud An5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1brJsjl0xI5L1GkQZfaE8oXErg7ibxkUzqbxER+swKM=; b=BIwS2Xxfw0M7NCaamhutAiPwA5cmdSkt4tXxhOjHXT5lwPLUMuf2cmdRPWic3cswfS gmRq4NKT7TqFbcggbhmYdqbSDuMJlyXjPh8OuR27SPf3mNCdzGXiHqKjv/jqQhmRrPry U5Z9b1YEdWdBeo5dPwiTQ/eOFgBZtW6PomF/Tod/YZP9ZN1etbJq7ggI8CJaBM+HFRXG jOsnFp3Fy7o5lgxjAm/HzBlZyqbIhIqubWBo8z3zb4LXTyeForaH4e3GvKPFNv/VJGId y4fNVgY76BB5BXgSltyEzckIwoJPXZuWs3DBriTNGNc/M71TlYsir3uj7fToZNgofauq DeRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=KerF0Dgg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=alliedtelesis.co.nz Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k63-20020a638442000000b0045fa2a39f4bsi2894748pgd.247.2022.10.09.20.16.24; Sun, 09 Oct 2022 20:16:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=KerF0Dgg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=alliedtelesis.co.nz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230072AbiJJCqt (ORCPT + 99 others); Sun, 9 Oct 2022 22:46:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230027AbiJJCqq (ORCPT ); Sun, 9 Oct 2022 22:46:46 -0400 Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [IPv6:2001:df5:b000:5::4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D6764B0F9 for ; Sun, 9 Oct 2022 19:46:44 -0700 (PDT) Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (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) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id C64B22C0746; Mon, 10 Oct 2022 02:46:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1665370000; bh=1brJsjl0xI5L1GkQZfaE8oXErg7ibxkUzqbxER+swKM=; h=From:To:Cc:Subject:Date:From; b=KerF0Dgg4+/Z9GKSxw+YXSAHcmrKpGI1le6Ue8uyebW0XnAbdT4RNe03MpWgxQTS0 feVAn13TzKaTZM9NlFH+QFgYnR6AmmN6wVajRyACmZljHRW2rG6IbhZzOUgZVFwdcL p2v8+UIw9yDFroAwWix2+T+vwxoB1Hy/imAGAbzu4wJY0JbXn42y5gBPDtso7aY8um DBcrNSZTuyHgpNpP1/mR1aAfhG03/mfeV035Bk6iS+2Mh5GmHJS8GzPcoJKOcPhv06 BmIBOT0TZp8MD/o+ke+qma/oCqZfIkEKlMffwGV7Phn9T6h28jDKQYuONEUrNW4J5K oHDILX0Ncveaw== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Mon, 10 Oct 2022 15:46:40 +1300 Received: from markto-dl.ws.atlnz.lc (markto-dl.ws.atlnz.lc [10.33.23.25]) by pat.atlnz.lc (Postfix) with ESMTP id 99B2713EDD7; Mon, 10 Oct 2022 15:46:40 +1300 (NZDT) Received: by markto-dl.ws.atlnz.lc (Postfix, from userid 1155) id 974C5340926; Mon, 10 Oct 2022 15:46:40 +1300 (NZDT) From: Mark Tomlinson To: jmaloy@redhat.com, ying.xue@windriver.com, davem@davemloft.net Cc: netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net, linux-kernel@vger.kernel.org, Mark Tomlinson Subject: [PATCH] tipc: Fix recognition of trial period Date: Mon, 10 Oct 2022 15:46:13 +1300 Message-Id: <20221010024613.2951-1-mark.tomlinson@alliedtelesis.co.nz> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SEG-SpamProfiler-Analysis: v=2.3 cv=UKij4xXy c=1 sm=1 tr=0 a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=Qawa6l4ZSaYA:10 a=CfVpqal7VN6jvvNFqYUA:9 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The trial period exists until jiffies is after addr_trial_end. But as jiffies will eventually overflow, just using time_after will eventually give incorrect results. As the node address is set once the trial period ends, this can be used to know that we are not in the trial period. Fixes: e415577f57f4 ("tipc: correct discovery message handling during add= ress trial period") Signed-off-by: Mark Tomlinson --- net/tipc/discover.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/tipc/discover.c b/net/tipc/discover.c index da69e1abf68f..e8630707901e 100644 --- a/net/tipc/discover.c +++ b/net/tipc/discover.c @@ -148,8 +148,8 @@ static bool tipc_disc_addr_trial_msg(struct tipc_disc= overer *d, { struct net *net =3D d->net; struct tipc_net *tn =3D tipc_net(net); - bool trial =3D time_before(jiffies, tn->addr_trial_end); u32 self =3D tipc_own_addr(net); + bool trial =3D time_before(jiffies, tn->addr_trial_end) && !self; =20 if (mtyp =3D=3D DSC_TRIAL_FAIL_MSG) { if (!trial) --=20 2.38.0