Skip to content

Commit c6d395e

Browse files
matttbekuba-moo
authored andcommitted
mptcp: pm: ADD_ADDR rtx: skip inactive subflows
When looking at the maximum RTO amongst the subflows, inactive subflows were taken into account: that includes stale ones, and the initial one if it has been already been closed. Unusable subflows are now simply skipped. Stale ones are used as an alternative: if there are only stale ones, to take their maximum RTO and avoid to eventually fallback to net.mptcp.add_addr_timeout, which is set to 2 minutes by default. Fixes: 30549ee ("mptcp: make ADD_ADDR retransmission timeout adaptive") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Link: https://patch.msgid.link/20260505-net-mptcp-pm-fixes-7-1-rc3-v1-7-fca8091060a4@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 3cf1249 commit c6d395e

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

net/mptcp/pm.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,18 +306,28 @@ static unsigned int mptcp_adjust_add_addr_timeout(struct mptcp_sock *msk)
306306
const struct net *net = sock_net((struct sock *)msk);
307307
unsigned int rto = mptcp_get_add_addr_timeout(net);
308308
struct mptcp_subflow_context *subflow;
309-
unsigned int max = 0;
309+
unsigned int max = 0, max_stale = 0;
310310

311311
mptcp_for_each_subflow(msk, subflow) {
312312
struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
313313
struct inet_connection_sock *icsk = inet_csk(ssk);
314314

315-
if (icsk->icsk_rto > max)
315+
if (!__mptcp_subflow_active(subflow))
316+
continue;
317+
318+
if (unlikely(subflow->stale)) {
319+
if (icsk->icsk_rto > max_stale)
320+
max_stale = icsk->icsk_rto;
321+
} else if (icsk->icsk_rto > max) {
316322
max = icsk->icsk_rto;
323+
}
317324
}
318325

319-
if (max && max < rto)
320-
rto = max;
326+
if (max)
327+
return min(max, rto);
328+
329+
if (max_stale)
330+
return min(max_stale, rto);
321331

322332
return rto;
323333
}

0 commit comments

Comments
 (0)