mptcp: add rm_list in mptcp_out_options
authorGeliang Tang <geliangtang@gmail.com>
Sat, 13 Mar 2021 01:16:11 +0000 (17:16 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 13 Mar 2021 01:47:45 +0000 (17:47 -0800)
commit6445e17af7c58b8a9be8ebf400b04c65202f6497
tree67e4c90f2383b8cfe6b7754eb61f4d4c48386d48
parente9e90a70cc2d5690b84c7ca2f604e09a85222bb1
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>
include/net/mptcp.h
net/mptcp/options.c
net/mptcp/pm.c
net/mptcp/protocol.h