summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>2022-10-10 15:46:13 +1300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-03 23:52:25 +0900
commitd62e0f037e482f2fbb671496a797ff807f292dd6 (patch)
tree0e6a01c4dc840929ab70a0275bec007032a8e622
parent0e15c89f5b27398e707ab8f865ad7995cb4fb8fa (diff)
downloadlinux-stable-d62e0f037e482f2fbb671496a797ff807f292dd6.tar.gz
linux-stable-d62e0f037e482f2fbb671496a797ff807f292dd6.tar.bz2
linux-stable-d62e0f037e482f2fbb671496a797ff807f292dd6.zip
tipc: Fix recognition of trial period
[ 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 <mark.tomlinson@alliedtelesis.co.nz> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--net/tipc/discover.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/discover.c b/net/tipc/discover.c
index c138d68e8a69..0006c9f87199 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -146,8 +146,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)