Skip to content

Commit 28be7ca

Browse files
Mark Tomlinsondavem330
authored andcommitted
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: e415577 ("tipc: correct discovery message handling during address trial period") Signed-off-by: Mark Tomlinson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 66ae043 commit 28be7ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/tipc/discover.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ static bool tipc_disc_addr_trial_msg(struct tipc_discoverer *d,
148148
{
149149
struct net *net = d->net;
150150
struct tipc_net *tn = tipc_net(net);
151-
bool trial = time_before(jiffies, tn->addr_trial_end);
152151
u32 self = tipc_own_addr(net);
152+
bool trial = time_before(jiffies, tn->addr_trial_end) && !self;
153153

154154
if (mtyp == DSC_TRIAL_FAIL_MSG) {
155155
if (!trial)

0 commit comments

Comments
 (0)