mptcp: pm: ADD_ADDR 0 is not a new address
authorMatthieu Baerts (NGI0) <matttbe@kernel.org>
Wed, 28 Aug 2024 06:14:37 +0000 (08:14 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 29 Aug 2024 08:39:50 +0000 (10:39 +0200)
commit57f86203b41c98b322119dfdbb1ec54ce5e3369b
tree0c5732f3d43a33f059413082a81281cc5259d4c9
parent20ccc7c5f7a3aa48092441a4b182f9f40418392e
mptcp: pm: ADD_ADDR 0 is not a new address

The ADD_ADDR 0 with the address from the initial subflow should not be
considered as a new address: this is not something new. If the host
receives it, it simply means that the address is available again.

When receiving an ADD_ADDR for the ID 0, the PM already doesn't consider
it as new by not incrementing the 'add_addr_accepted' counter. But the
'accept_addr' might not be set if the limit has already been reached:
this can be bypassed in this case. But before, it is important to check
that this ADD_ADDR for the ID 0 is for the same address as the initial
subflow. If not, it is not something that should happen, and the
ADD_ADDR can be ignored.

Note that if an ADD_ADDR is received while there is already a subflow
opened using the same address, this ADD_ADDR is ignored as well. It
means that if multiple ADD_ADDR for ID 0 are received, there will not be
any duplicated subflows created by the client.

Fixes: d0876b2284cf ("mptcp: add the incoming RM_ADDR support")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/mptcp/pm.c
net/mptcp/pm_netlink.c
net/mptcp/protocol.h