]> git.ipfire.org Git - thirdparty/linux.git/commit
mptcp: pm: in-kernel: compare IDs instead of addresses
authorMatthieu Baerts (NGI0) <matttbe@kernel.org>
Thu, 25 Sep 2025 10:32:49 +0000 (12:32 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 27 Sep 2025 00:44:05 +0000 (17:44 -0700)
commitf596293314b25fc494acb42f40ec256e4662d04f
tree4da27b8a7dd90cf92d0932b3ca4b028610f720b5
parent4984fe6254f8d469c98e639856b7ce21fe8da86f
mptcp: pm: in-kernel: compare IDs instead of addresses

When receiving an ADD_ADDR right after the 3WHS, the connection will
switch to 'fully established'. It means the MPTCP worker will be called
to treat two events, in this order: ADD_ADDR_RECEIVED, PM_ESTABLISHED.

The MPTCP endpoints cannot have the ID 0, because it is reserved to the
address and port used by the initial subflow. To be able to deal with
this case in different places, msk->mpc_endpoint_id contains the
endpoint ID linked to the initial subflow. This variable was only set
when treating the first PM_ESTABLISHED event, after ADD_ADDR_RECEIVED.
That's why in fill_local_addresses_vec(), the endpoint addresses were
compared with the one of the initial subflow, instead of only comparing
the IDs.

Instead, msk->mpc_endpoint_id is now set when treating ADD_ADDR_RECEIVED
as well, if needed, then the IDs can be compared.

To be able to do so, the code doing that is now in a dedicated helper,
and called from the functions linked to the two actions.

While at it, mptcp_endp_get_local_id() has also been moved up, next to
this new helper, because they are linked, and to be able to use it in
fill_local_addresses_vec() in the next commit.

Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20250925-net-next-mptcp-c-flag-laminar-v1-14-ad126cc47c6b@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/pm_kernel.c