tipc: Fix recognition of trial period
authorMark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Mon, 10 Oct 2022 02:46:13 +0000 (15:46 +1300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Oct 2022 08:12:55 +0000 (10:12 +0200)
commitb294cad6f02ef89fed5d14ca6af528d7f5217a3a
treebe2243ac417844d82b3a6ef7580c925fa9d3afff
parent6161c364e378660f059194c81ccd855fd35ec997
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>
net/tipc/discover.c