summaryrefslogtreecommitdiff
path: root/net/mptcp/protocol.h
diff options
context:
space:
mode:
authorChristoph Paasch <cpaasch@apple.com>2020-01-21 16:56:32 -0800
committerDavid S. Miller <davem@davemloft.net>2020-01-24 13:44:08 +0100
commitd22f4988ffecbe284e4d00e897525adbd0edd801 (patch)
treed1e7660e53298c99fa14f7cb973a5b0f04a71780 /net/mptcp/protocol.h
parentcc7972ea1932335e0a0ee00ac8a24b3e8304630d (diff)
mptcp: process MP_CAPABLE data option
This patch implements the handling of MP_CAPABLE + data option, as per RFC 6824 bis / RFC 8684: MPTCP v1. On the server side we can receive the remote key after that the connection is established. We need to explicitly track the 'missing remote key' status and avoid emitting a mptcp ack until we get such info. When a late/retransmitted/OoO pkt carrying MP_CAPABLE[+data] option is received, we have to propagate the mptcp seq number info to the msk socket. To avoid ABBA locking issue, explicitly check for that in recvmsg(), where we own msk and subflow sock locks. The above also means that an established mp_capable subflow - still waiting for the remote key - can be 'downgraded' to plain TCP. Such change could potentially block a reader waiting for new data forever - as they hook to msk, while later wake-up after the downgrade will be on subflow only. The above issue is not handled here, we likely have to get rid of msk->fallback to handle that cleanly. Signed-off-by: Christoph Paasch <cpaasch@apple.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, 7 insertions, 3 deletions
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 36b90024d34d..10eaa7c7381b 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -69,6 +69,7 @@ struct mptcp_sock {
u64 ack_seq;
u32 token;
unsigned long flags;
+ bool can_ack;
struct list_head conn_list;
struct skb_ext *cached_ext; /* for the next sendmsg */
struct socket *subflow; /* outgoing connect/listener/!mp_capable */
@@ -84,9 +85,10 @@ static inline struct mptcp_sock *mptcp_sk(const struct sock *sk)
struct mptcp_subflow_request_sock {
struct tcp_request_sock sk;
- u8 mp_capable : 1,
+ u16 mp_capable : 1,
mp_join : 1,
- backup : 1;
+ backup : 1,
+ remote_key_valid : 1;
u64 local_key;
u64 remote_key;
u64 idsn;
@@ -118,8 +120,10 @@ struct mptcp_subflow_context {
fourth_ack : 1, /* send initial DSS */
conn_finished : 1,
map_valid : 1,
+ mpc_map : 1,
data_avail : 1,
- rx_eof : 1;
+ rx_eof : 1,
+ can_ack : 1; /* only after processing the remote a key */
struct sock *tcp_sock; /* tcp sk backpointer */
struct sock *conn; /* parent mptcp_sock */