diff options
author | Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz> | 2022-10-10 04:46:13 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-10-14 09:17:52 +0200 |
commit | 28be7ca4fcfd69a2d52aaa331adbf9dbe91f9e6e (patch) | |
tree | 48ef789d9109b965ff5bed4da716b51790e10ff1 /net/tipc | |
parent | Merge tag 'net-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netd... (diff) | |
download | linux-28be7ca4fcfd69a2d52aaa331adbf9dbe91f9e6e.tar.xz linux-28be7ca4fcfd69a2d52aaa331adbf9dbe91f9e6e.zip |
tipc: Fix recognition of trial period
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>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/discover.c | 2 |
1 files changed, 1 insertions, 1 deletions
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_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) |