Skip to content

Commit 154598f

Browse files
Geliang Tangintel-lab-lkp
authored andcommitted
mptcp: disable add_addr retransmission when timeout is 0
When add_addr_timeout is set to 0, it indicates that ADD_ADDR retransmissions should be disabled. This patch implements the logic to skip retransmissions when the timeout value is zero. The documentation is updated to explicitly state that setting the timeout to 0 disables retransmission. Suggested-by: Matthieu Baerts <[email protected]> Signed-off-by: Geliang Tang <[email protected]>
1 parent f0df0a1 commit 154598f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Documentation/networking/mptcp-sysctl.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ add_addr_timeout - INTEGER (seconds)
1212
resent to an MPTCP peer that has not acknowledged a previous
1313
ADD_ADDR message.
1414

15+
Do not retransmit if set to 0.
16+
1517
The default value matches TCP_RTO_MAX. This is a per-namespace
1618
sysctl.
1719

net/mptcp/pm.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer)
274274
add_timer);
275275
struct mptcp_sock *msk = entry->sock;
276276
struct sock *sk = (struct sock *)msk;
277+
unsigned int timeout;
277278

278279
pr_debug("msk=%p\n", msk);
279280

@@ -291,6 +292,10 @@ static void mptcp_pm_add_timer(struct timer_list *timer)
291292
goto out;
292293
}
293294

295+
timeout = mptcp_get_add_addr_timeout(sock_net(sk));
296+
if (!timeout)
297+
goto out;
298+
294299
spin_lock_bh(&msk->pm.lock);
295300

296301
if (!mptcp_pm_should_add_signal_addr(msk)) {
@@ -302,7 +307,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer)
302307

303308
if (entry->retrans_times < ADD_ADDR_RETRANS_MAX)
304309
sk_reset_timer(sk, timer,
305-
jiffies + mptcp_get_add_addr_timeout(sock_net(sk)));
310+
jiffies + timeout);
306311

307312
spin_unlock_bh(&msk->pm.lock);
308313

0 commit comments

Comments
 (0)