lkml.org 
[lkml]   [2020]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH net-next 3/3] mptcp: add MP_FASTCLOSE suboption handling
Date
Add handling for sending and receiving MP_FASTCLOSE suboption.

Signed-off-by: Geliang Tang <geliangtang@gmail.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
\
 
 \ /
  Last update: 2020-06-16 08:57    [W:0.042 / U:0.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site