mptcp: only send RM_ADDR in nl_cmd_remove
authorGeliang Tang <geliang.tang@suse.com>
Mon, 5 Jun 2023 03:25:17 +0000 (20:25 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Jun 2023 14:15:57 +0000 (15:15 +0100)
commit8b1c94da1e481090f24127b2c420b0c0b0421ce3
tree160a795d7acc1cea1c3a49fc53180ac033554912
parent9bc009734774549f8bb8d7e526ba10e70d751a7c
mptcp: only send RM_ADDR in nl_cmd_remove

The specifications from [1] about the "REMOVE" command say:

    Announce that an address has been lost to the peer

It was then only supposed to send a RM_ADDR and not trying to delete
associated subflows.

A new helper mptcp_pm_remove_addrs() is then introduced to do just
that, compared to mptcp_pm_remove_addrs_and_subflows() also removing
subflows.

To delete a subflow, the userspace daemon can use the "SUB_DESTROY"
command, see mptcp_nl_cmd_sf_destroy().

Fixes: d9a4594edabf ("mptcp: netlink: Add MPTCP_PM_CMD_REMOVE")
Link: https://github.com/multipath-tcp/mptcp/blob/mptcp_v0.96/include/uapi/linux/mptcp.h
Cc: stable@vger.kernel.org
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Signed-off-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/pm_netlink.c
net/mptcp/pm_userspace.c
net/mptcp/protocol.h