]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: do not check hb_timer.expires when resetting hb_timer
authorXin Long <lucien.xin@gmail.com>
Mon, 30 Jan 2023 16:25:33 +0000 (11:25 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2023 10:28:09 +0000 (11:28 +0100)
commitd36c90e56d4d65aa7a50ebccd0caa5047af8366c
tree3508114679055e908cb8a44f0213358682e0d036
parentdb327c8ab97dac2fb49f01fcdfdd37abcff04958
sctp: do not check hb_timer.expires when resetting hb_timer

[ Upstream commit b5c2701fabb5727a3052f7a9e25e9bc48c535ef4 ]

It tries to avoid the frequently hb_timer refresh in commit a903b312feb8
("sctp: avoid refreshing heartbeat timer too often"), and it only allows
mod_timer when the new expires is after hb_timer.expires. It means even
a much shorter interval for hb timer gets applied, it will have to wait
until the current hb timer to time out.

In sctp_do_8_2_transport_strike(), when a transport enters PF state, it
expects to update the hb timer to resend a heartbeat every rto after
calling sctp_transport_reset_hb_timer(), which will not work as the
change mentioned above.

The frequently hb_timer refresh was caused by sctp_transport_reset_timers()
called in sctp_outq_flush() and it was already removed in the commit above.
So we don't have to check hb_timer.expires when resetting hb_timer as it is
now not called very often.

Fixes: a903b312feb8 ("sctp: avoid refreshing heartbeat timer too often")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Link: https://lore.kernel.org/r/d958c06985713ec84049a2d5664879802710179a.1675095933.git.lucien.xin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sctp/transport.c