]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/5.10.152/tipc-fix-recognition-of-trial-period.patch
5.4-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 5.10.152 / tipc-fix-recognition-of-trial-period.patch
CommitLineData
fb483658
SL
1From c7e813435954cb70adcbcad1079b3ae4db834d85 Mon Sep 17 00:00:00 2001
2From: Sasha Levin <sashal@kernel.org>
3Date: Mon, 10 Oct 2022 15:46:13 +1300
4Subject: tipc: Fix recognition of trial period
5
6From: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
7
8[ Upstream commit 28be7ca4fcfd69a2d52aaa331adbf9dbe91f9e6e ]
9
10The trial period exists until jiffies is after addr_trial_end. But as
11jiffies will eventually overflow, just using time_after will eventually
12give incorrect results. As the node address is set once the trial period
13ends, this can be used to know that we are not in the trial period.
14
15Fixes: e415577f57f4 ("tipc: correct discovery message handling during address trial period")
16Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
17Signed-off-by: David S. Miller <davem@davemloft.net>
18Signed-off-by: Sasha Levin <sashal@kernel.org>
19---
20 net/tipc/discover.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23diff --git a/net/tipc/discover.c b/net/tipc/discover.c
24index 14bc20604051..2ae268b67465 100644
25--- a/net/tipc/discover.c
26+++ b/net/tipc/discover.c
27@@ -147,8 +147,8 @@ static bool tipc_disc_addr_trial_msg(struct tipc_discoverer *d,
28 {
29 struct net *net = d->net;
30 struct tipc_net *tn = tipc_net(net);
31- bool trial = time_before(jiffies, tn->addr_trial_end);
32 u32 self = tipc_own_addr(net);
33+ bool trial = time_before(jiffies, tn->addr_trial_end) && !self;
34
35 if (mtyp == DSC_TRIAL_FAIL_MSG) {
36 if (!trial)
37--
382.35.1
39