Commit 6a7d8cff authored by Hoang Le's avatar Hoang Le Committed by Paolo Abeni

tipc: fix the timer expires after interval 100ms

In the timer callback function tipc_sk_timeout(), we're trying to
reschedule another timeout to retransmit a setup request if destination
link is congested. But we use the incorrect timeout value
(msecs_to_jiffies(100)) instead of (jiffies + msecs_to_jiffies(100)),
so that the timer expires immediately, it's irrelevant for original
description.

In this commit we correct the timeout value in sk_reset_timer()

Fixes: 67879274 ("tipc: buffer overflow handling in listener socket")
Acked-by: default avatarYing Xue <ying.xue@windriver.com>
Signed-off-by: default avatarHoang Le <hoang.h.le@dektech.com.au>
Link: https://lore.kernel.org/r/20220321042229.314288-1-hoang.h.le@dektech.com.auSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 6b3c7455
...@@ -2852,7 +2852,8 @@ static void tipc_sk_retry_connect(struct sock *sk, struct sk_buff_head *list) ...@@ -2852,7 +2852,8 @@ static void tipc_sk_retry_connect(struct sock *sk, struct sk_buff_head *list)
/* Try again later if dest link is congested */ /* Try again later if dest link is congested */
if (tsk->cong_link_cnt) { if (tsk->cong_link_cnt) {
sk_reset_timer(sk, &sk->sk_timer, msecs_to_jiffies(100)); sk_reset_timer(sk, &sk->sk_timer,
jiffies + msecs_to_jiffies(100));
return; return;
} }
/* Prepare SYN for retransmit */ /* Prepare SYN for retransmit */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment