summaryrefslogtreecommitdiffstats
path: root/net/mptcp/pm.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@gmail.com>2021-03-13 02:16:13 +0100
committerDavid S. Miller <davem@davemloft.net>2021-03-13 02:47:45 +0100
commit5c4a824dcb589f3da2574dd99e761063e7d5529d (patch)
treed70bd1882ebf4eb2190a81b4d2cdf35c351f9eea /net/mptcp/pm.c
parentmptcp: add rm_list_tx in mptcp_pm_data (diff)
downloadlinux-5c4a824dcb589f3da2574dd99e761063e7d5529d.tar.xz
linux-5c4a824dcb589f3da2574dd99e761063e7d5529d.zip
mptcp: add rm_list in mptcp_options_received
This patch changed the member rm_id in struct mptcp_options_received as a list of the removing address ids, and renamed it to rm_list. In mptcp_parse_option, parsed the RM_ADDR suboption and filled them into the rm_list in struct mptcp_options_received. In mptcp_incoming_options, passed this rm_list to the function mptcp_pm_rm_addr_received. It also changed the parameter type of mptcp_pm_rm_addr_received. 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.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 9a91605885bb..7553f82076ca 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -205,17 +205,20 @@ void mptcp_pm_add_addr_send_ack(struct mptcp_sock *msk)
mptcp_pm_schedule_work(msk, MPTCP_PM_ADD_ADDR_SEND_ACK);
}
-void mptcp_pm_rm_addr_received(struct mptcp_sock *msk, u8 rm_id)
+void mptcp_pm_rm_addr_received(struct mptcp_sock *msk,
+ const struct mptcp_rm_list *rm_list)
{
struct mptcp_pm_data *pm = &msk->pm;
+ u8 i;
- pr_debug("msk=%p remote_id=%d", msk, rm_id);
+ pr_debug("msk=%p remote_ids_nr=%d", msk, rm_list->nr);
- mptcp_event_addr_removed(msk, rm_id);
+ for (i = 0; i < rm_list->nr; i++)
+ mptcp_event_addr_removed(msk, rm_list->ids[i]);
spin_lock_bh(&pm->lock);
mptcp_pm_schedule_work(msk, MPTCP_PM_RM_ADDR_RECEIVED);
- pm->rm_id = rm_id;
+ pm->rm_id = rm_list->ids[0];
spin_unlock_bh(&pm->lock);
}