summaryrefslogtreecommitdiffstats
path: root/net/mptcp/pm.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@gmail.com>2021-03-13 02:16:11 +0100
committerDavid S. Miller <davem@davemloft.net>2021-03-13 02:47:45 +0100
commit6445e17af7c58b8a9be8ebf400b04c65202f6497 (patch)
tree67e4c90f2383b8cfe6b7754eb61f4d4c48386d48 /net/mptcp/pm.c
parentMerge branch 'resil-nhgroups-netdevsim-selftests' (diff)
downloadlinux-6445e17af7c58b8a9be8ebf400b04c65202f6497.tar.xz
linux-6445e17af7c58b8a9be8ebf400b04c65202f6497.zip
mptcp: add rm_list in mptcp_out_options
This patch defined a new struct mptcp_rm_list, the ids field was an array of the removing address ids, the nr field was the valid number of removing address ids in the array. The array size was definced as a new macro MPTCP_RM_IDS_MAX. Changed the member rm_id of struct mptcp_out_options to rm_list. In mptcp_established_options_rm_addr, invoked mptcp_pm_rm_addr_signal to get the rm_list. According the number of addresses in it, calculated the padded RM_ADDR suboption length. And saved the ids array in struct mptcp_out_options's rm_list member. In mptcp_write_options, iterated each address id from struct mptcp_out_options's rm_list member, set the invalid ones as TCPOPT_NOP, then filled them into the RM_ADDR suboption. Changed TCPOLEN_MPTCP_RM_ADDR_BASE from 4 to 3. Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp/pm.c')
-rw-r--r--net/mptcp/pm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 6fd4b2c1b076..0654c86cd5ff 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -258,7 +258,7 @@ out_unlock:
}
bool mptcp_pm_rm_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
- u8 *rm_id)
+ struct mptcp_rm_list *rm_list)
{
int ret = false;
@@ -271,7 +271,8 @@ bool mptcp_pm_rm_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
if (remaining < TCPOLEN_MPTCP_RM_ADDR_BASE)
goto out_unlock;
- *rm_id = msk->pm.rm_id;
+ rm_list->ids[0] = msk->pm.rm_id;
+ rm_list->nr = 1;
WRITE_ONCE(msk->pm.addr_signal, 0);
ret = true;