Skip to content

Commit

Permalink
mptcp: fix local endpoint accounting
Browse files Browse the repository at this point in the history
In mptcp_pm_nl_rm_addr_or_subflow() we always mark as available
the id corresponding to the just removed address.

The used bitmap actually tracks only the local IDs: we must
restrict the operation when a (local) subflow is removed.

Fixes: a88c9e4 ("mptcp: do not block subflows creation on errors")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Paolo Abeni authored and David S. Miller committed Jul 6, 2022
1 parent ca188a2 commit 843b5e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/mptcp/pm_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,8 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk,
removed = true;
__MPTCP_INC_STATS(sock_net(sk), rm_type);
}
__set_bit(rm_list->ids[i], msk->pm.id_avail_bitmap);
if (rm_type == MPTCP_MIB_RMSUBFLOW)
__set_bit(rm_list->ids[i], msk->pm.id_avail_bitmap);
if (!removed)
continue;

Expand Down

0 comments on commit 843b5e7

Please sign in to comment.