[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <6f0156a5c3304ce50521306a57e2483406f4d122.1592289629.git.geliangtang@gmail.com>
Date: Tue, 16 Jun 2020 14:47:38 +0800
From: Geliang Tang <geliangtang@...il.com>
To: Mat Martineau <mathew.j.martineau@...ux.intel.com>,
Matthieu Baerts <matthieu.baerts@...sares.net>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Cc: Geliang Tang <geliangtang@...il.com>, netdev@...r.kernel.org,
mptcp@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [PATCH net-next 3/3] mptcp: add MP_FASTCLOSE suboption handling
Add handling for sending and receiving MP_FASTCLOSE suboption.
Signed-off-by: Geliang Tang <geliangtang@...il.com>
---
net/mptcp/options.c | 16 ++++++++++++++++
net/mptcp/protocol.h | 2 ++
2 files changed, 18 insertions(+)
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 82b3d7c566b4..a99b3989fec1 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -297,6 +297,15 @@ static void mptcp_parse_option(const struct sk_buff *skb,
pr_debug("MP_FAIL: data_seq=%lld", mp_opt->data_seq);
break;
+ case MPTCPOPT_MP_FASTCLOSE:
+ if (opsize != TCPOLEN_MPTCP_FASTCLOSE)
+ break;
+
+ ptr += 2;
+ mp_opt->rcvr_key = get_unaligned_be64(ptr);
+ pr_debug("MP_FASTCLOSE: rcvr_key=%lld", mp_opt->rcvr_key);
+ break;
+
default:
break;
}
@@ -993,6 +1002,13 @@ void mptcp_write_options(__be32 *ptr, struct mptcp_out_options *opts)
put_unaligned_be64(mpext->data_seq, ptr);
}
+ if (OPTION_MPTCP_FASTCLOSE & opts->suboptions) {
+ *ptr++ = mptcp_option(MPTCPOPT_MP_FASTCLOSE,
+ TCPOLEN_MPTCP_FASTCLOSE,
+ 0, 0);
+ put_unaligned_be64(opts->rcvr_key, ptr);
+ }
+
if (OPTION_MPTCP_MPJ_SYN & opts->suboptions) {
*ptr++ = mptcp_option(MPTCPOPT_MP_JOIN,
TCPOLEN_MPTCP_MPJ_SYN,
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index e6ae0a73716b..a8faab61e7af 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -25,6 +25,7 @@
#define OPTION_MPTCP_RM_ADDR BIT(8)
#define OPTION_MPTCP_PRIO BIT(9)
#define OPTION_MPTCP_FAIL BIT(10)
+#define OPTION_MPTCP_FASTCLOSE BIT(11)
/* MPTCP option subtypes */
#define MPTCPOPT_MP_CAPABLE 0
@@ -62,6 +63,7 @@
#define TCPOLEN_MPTCP_RM_ADDR_BASE 4
#define TCPOLEN_MPTCP_PRIO 3
#define TCPOLEN_MPTCP_FAIL 12
+#define TCPOLEN_MPTCP_FASTCLOSE 12
/* MPTCP MP_JOIN flags */
#define MPTCPOPT_BACKUP BIT(0)
--
2.17.1
Powered by blists - more mailing lists