Skip to content

Commit

Permalink
tipc: fix the timer expires after interval 100ms
Browse files Browse the repository at this point in the history
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: 6787927 ("tipc: buffer overflow handling in listener socket")
Acked-by: Ying Xue <[email protected]>
Signed-off-by: Hoang Le <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
  • Loading branch information
Hoang Le authored and Paolo Abeni committed Mar 22, 2022
1 parent 6b3c745 commit 6a7d8cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/tipc/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
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;
}
/* Prepare SYN for retransmit */
Expand Down

0 comments on commit 6a7d8cf

Please sign in to comment.