aboutsummaryrefslogtreecommitdiffstats
path: root/net/mptcp/protocol.h
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@gmail.com>2020-12-09 15:51:20 -0800
committerDavid S. Miller <davem@davemloft.net>2020-12-09 19:02:15 -0800
commit22fb85ffaefb80a22c815008a500273b3f61bba3 (patch)
tree77ba46a7f23fba32cd5de9bc990591f1ccdb3dcc /net/mptcp/protocol.h
parentmptcp: unify ADD_ADDR and ADD_ADDR6 suboptions writing (diff)
downloadlinux-dev-22fb85ffaefb80a22c815008a500273b3f61bba3.tar.xz
linux-dev-22fb85ffaefb80a22c815008a500273b3f61bba3.zip
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>
Diffstat (limited to 'net/mptcp/protocol.h')
-rw-r--r--net/mptcp/protocol.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index fc56e730fb35..9032174b446a 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -49,14 +49,14 @@
#define TCPOLEN_MPTCP_DSS_MAP64 14
#define TCPOLEN_MPTCP_DSS_CHECKSUM 2
#define TCPOLEN_MPTCP_ADD_ADDR 16
-#define TCPOLEN_MPTCP_ADD_ADDR_PORT 18
+#define TCPOLEN_MPTCP_ADD_ADDR_PORT 20
#define TCPOLEN_MPTCP_ADD_ADDR_BASE 8
-#define TCPOLEN_MPTCP_ADD_ADDR_BASE_PORT 10
+#define TCPOLEN_MPTCP_ADD_ADDR_BASE_PORT 12
#define TCPOLEN_MPTCP_ADD_ADDR6 28
-#define TCPOLEN_MPTCP_ADD_ADDR6_PORT 30
+#define TCPOLEN_MPTCP_ADD_ADDR6_PORT 32
#define TCPOLEN_MPTCP_ADD_ADDR6_BASE 20
-#define TCPOLEN_MPTCP_ADD_ADDR6_BASE_PORT 22
-#define TCPOLEN_MPTCP_PORT_LEN 2
+#define TCPOLEN_MPTCP_ADD_ADDR6_BASE_PORT 24
+#define TCPOLEN_MPTCP_PORT_LEN 4
#define TCPOLEN_MPTCP_RM_ADDR_BASE 4
/* MPTCP MP_JOIN flags */