mptcp: add port support for ADD_ADDR suboption writing
authorGeliang Tang <geliangtang@gmail.com>
Wed, 9 Dec 2020 23:51:20 +0000 (15:51 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Dec 2020 03:02:15 +0000 (19:02 -0800)
commit22fb85ffaefb80a22c815008a500273b3f61bba3
tree77ba46a7f23fba32cd5de9bc990591f1ccdb3dcc
parente1ef6832224aa62b36ba98a1a7c183e41962590c
mptcp: add port support for ADD_ADDR suboption writing

In rfc8684, the length of ADD_ADDR suboption with IPv4 address and port
is 18 octets, but mptcp_write_options is 32-bit aligned, so we need to
pad it to 20 octets. All the other port related option lengths need to
be added up 2 octets similarly.

This patch added a new field 'port' in mptcp_out_options. When this
field is set with a port number, we need to add up 4 octets for the
ADD_ADDR suboption, and put the port number into the suboption.

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/protocol.h