Skip to content

Commit 318bb94

Browse files
matttbegregkh
authored andcommitted
mptcp: pm: ADD_ADDR rtx: skip inactive subflows
commit c6d395e upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 38bcc21 commit 318bb94

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
@@ -305,18 +305,28 @@ static unsigned int mptcp_adjust_add_addr_timeout(struct mptcp_sock *msk)
305305
const struct net *net = sock_net((struct sock *)msk);
306306
unsigned int rto = mptcp_get_add_addr_timeout(net);
307307
struct mptcp_subflow_context *subflow;
308-
unsigned int max = 0;
308+
unsigned int max = 0, max_stale = 0;
309309

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

314-
if (icsk->icsk_rto > max)
314+
if (!__mptcp_subflow_active(subflow))
315+
continue;
316+
317+
if (unlikely(subflow->stale)) {
318+
if (icsk->icsk_rto > max_stale)
319+
max_stale = icsk->icsk_rto;
320+
} else if (icsk->icsk_rto > max) {
315321
max = icsk->icsk_rto;
322+
}
316323
}
317324

318-
if (max && max < rto)
319-
rto = max;
325+
if (max)
326+
return min(max, rto);
327+
328+
if (max_stale)
329+
return min(max_stale, rto);
320330

321331
return rto;
322332
}

0 commit comments

Comments
 (0)