Skip to content

Commit

Permalink
mptcp: pm: send ACK on non-stale subflows
Browse files Browse the repository at this point in the history
If the subflow is considered as "staled", it is better to avoid it to
send an ACK carrying an ADD_ADDR or RM_ADDR. Another subflow, if any,
will then be selected.

Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Signed-off-by: NipaLocal <nipa@local>
  • Loading branch information
matttbe authored and NipaLocal committed Oct 27, 2024
1 parent 22277af commit 7059db8
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions net/mptcp/pm_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ bool mptcp_pm_nl_is_init_remote_addr(struct mptcp_sock *msk,

void mptcp_pm_nl_addr_send_ack(struct mptcp_sock *msk)
{
struct mptcp_subflow_context *subflow;
struct mptcp_subflow_context *subflow, *alt = NULL;

msk_owned_by_me(msk);
lockdep_assert_held(&msk->pm.lock);
Expand All @@ -792,10 +792,18 @@ void mptcp_pm_nl_addr_send_ack(struct mptcp_sock *msk)

mptcp_for_each_subflow(msk, subflow) {
if (__mptcp_subflow_active(subflow)) {
mptcp_pm_send_ack(msk, subflow, false, false);
break;
if (!subflow->stale) {
mptcp_pm_send_ack(msk, subflow, false, false);
return;
}

if (!alt)
alt = subflow;
}
}

if (alt)
mptcp_pm_send_ack(msk, alt, false, false);
}

int mptcp_pm_nl_mp_prio_send_ack(struct mptcp_sock *msk,
Expand Down

0 comments on commit 7059db8

Please sign in to comment.