]>
Commit | Line | Data |
---|---|---|
fb483658 SL |
1 | From c7e813435954cb70adcbcad1079b3ae4db834d85 Mon Sep 17 00:00:00 2001 |
2 | From: Sasha Levin <sashal@kernel.org> | |
3 | Date: Mon, 10 Oct 2022 15:46:13 +1300 | |
4 | Subject: tipc: Fix recognition of trial period | |
5 | ||
6 | From: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz> | |
7 | ||
8 | [ Upstream commit 28be7ca4fcfd69a2d52aaa331adbf9dbe91f9e6e ] | |
9 | ||
10 | The trial period exists until jiffies is after addr_trial_end. But as | |
11 | jiffies will eventually overflow, just using time_after will eventually | |
12 | give incorrect results. As the node address is set once the trial period | |
13 | ends, this can be used to know that we are not in the trial period. | |
14 | ||
15 | Fixes: e415577f57f4 ("tipc: correct discovery message handling during address trial period") | |
16 | Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz> | |
17 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
18 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
19 | --- | |
20 | net/tipc/discover.c | 2 +- | |
21 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
22 | ||
23 | diff --git a/net/tipc/discover.c b/net/tipc/discover.c | |
24 | index 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 | -- | |
38 | 2.35.1 | |
39 |