From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5ECA23A3 for ; Fri, 28 Oct 2022 12:05:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B73DC433C1; Fri, 28 Oct 2022 12:05:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666958706; bh=yCVUPlFb9eOLdQPkEjgCEVBE1snfYheSL+9eN/PUsrk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dDQa27axJjsN6WUUZOoaRb8+u8yNQ2He3aZlsPMLVe280iBBCE5kLIy9zmqC4UwMT 9d+O75E+ofqtvKe98BsqiLerZS98pOGv+RdaZXjoMWv73L7Gli2dyQPSUF44hvoOcX Q/DTBQ83DhLzc8rClPEKSTrKeN92ZrCqM6nRNlGk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mark Tomlinson , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 22/73] tipc: Fix recognition of trial period Date: Fri, 28 Oct 2022 14:03:19 +0200 Message-Id: <20221028120233.307645402@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221028120232.344548477@linuxfoundation.org> References: <20221028120232.344548477@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Mark Tomlinson [ Upstream commit 28be7ca4fcfd69a2d52aaa331adbf9dbe91f9e6e ] 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 address trial period") Signed-off-by: Mark Tomlinson Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 14bc20604051..2ae268b67465 100644 --- a/net/tipc/discover.c +++ b/net/tipc/discover.c @@ -147,8 +147,8 @@ static bool tipc_disc_addr_trial_msg(struct tipc_discoverer *d, { struct net *net = d->net; struct tipc_net *tn = tipc_net(net); - bool trial = time_before(jiffies, tn->addr_trial_end); u32 self = tipc_own_addr(net); + bool trial = time_before(jiffies, tn->addr_trial_end) && !self; if (mtyp == DSC_TRIAL_FAIL_MSG) { if (!trial) -- 2.35.1