summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2023-10-01 11:04:20 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-10-10 21:43:41 +0200
commitcdb32abc2001894b9073f6067e0f4d3697ace06a (patch)
tree31933bc5c8e8e8f60af0fdaa6004358401b54ec5 /net
parent7083c1f64e3b67fea5a37f3b88d99cf6090d4c24 (diff)
downloadlinux-cdb32abc2001894b9073f6067e0f4d3697ace06a.tar.gz
linux-cdb32abc2001894b9073f6067e0f4d3697ace06a.tar.bz2
linux-cdb32abc2001894b9073f6067e0f4d3697ace06a.zip
sctp: update hb timer immediately after users change hb_interval
[ Upstream commit 1f4e803cd9c9166eb8b6c8b0b8e4124f7499fc07 ] Currently, when hb_interval is changed by users, it won't take effect until the next expiry of hb timer. As the default value is 30s, users have to wait up to 30s to wait its hb_interval update to work. This becomes pretty bad in containers where a much smaller value is usually set on hb_interval. This patch improves it by resetting the hb timer immediately once the value of hb_interval is updated by users. Note that we don't address the already existing 'problem' when sending a heartbeat 'on demand' if one hb has just been sent(from the timer) mentioned in: https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg590224.html Signed-off-by: Xin Long <lucien.xin@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Link: https://lore.kernel.org/r/75465785f8ee5df2fb3acdca9b8fafdc18984098.1696172660.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/sctp/socket.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index e5c3c37108e4..fe26395690f3 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -2479,6 +2479,7 @@ static int sctp_apply_peer_addr_params(struct sctp_paddrparams *params,
if (trans) {
trans->hbinterval =
msecs_to_jiffies(params->spp_hbinterval);
+ sctp_transport_reset_hb_timer(trans);
} else if (asoc) {
asoc->hbinterval =
msecs_to_jiffies(params->spp_hbinterval);