diff options
author | David S. Miller <davem@davemloft.net> | 2020-05-15 12:30:13 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-15 12:30:13 -0700 |
commit | 93d43e58683efd958a0421b932a273df74e0e008 (patch) | |
tree | dd27101a3b5e26414458c2d0e9180a30d66025bd /include/net/mptcp.h | |
parent | ca1c933bcee9393d8a83c6be1093471e0c3b655d (diff) | |
parent | 729cd6436f359b6e618c2f14836d419f40444503 (diff) |
Merge branch 'mptcp-fix-MP_JOIN-failure-handling'
Paolo Abeni says:
====================
mptcp: fix MP_JOIN failure handling
Currently if we hit an MP_JOIN failure on the third ack, the child socket is
closed with reset, but the request socket is not deleted, causing weird
behaviors.
The main problem is that MPTCP's MP_JOIN code needs to plug it's own
'valid 3rd ack' checks and the current TCP callbacks do not allow that.
This series tries to address the above shortcoming introducing a new MPTCP
specific bit in a 'struct tcp_request_sock' hole, and leveraging that to allow
tcp_check_req releasing the request socket when needed.
The above allows cleaning-up a bit current MPTCP hooking in tcp_check_req().
An alternative solution, possibly cleaner but more invasive, would be
changing the 'bool *own_req' syn_recv_sock() argument into 'int *req_status'
and let MPTCP set it to 'REQ_DROP'.
v1 -> v2:
- be more conservative about drop_req initialization
RFC -> v1:
- move the drop_req bit inside tcp_request_sock (Eric)
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/mptcp.h')
-rw-r--r-- | include/net/mptcp.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/include/net/mptcp.h b/include/net/mptcp.h index e60275659de6..c4a6ef4ba35b 100644 --- a/include/net/mptcp.h +++ b/include/net/mptcp.h @@ -68,6 +68,11 @@ static inline bool rsk_is_mptcp(const struct request_sock *req) return tcp_rsk(req)->is_mptcp; } +static inline bool rsk_drop_req(const struct request_sock *req) +{ + return tcp_rsk(req)->is_mptcp && tcp_rsk(req)->drop_req; +} + void mptcp_space(const struct sock *ssk, int *space, int *full_space); bool mptcp_syn_options(struct sock *sk, const struct sk_buff *skb, unsigned int *size, struct mptcp_out_options *opts); @@ -121,8 +126,6 @@ static inline bool mptcp_skb_can_collapse(const struct sk_buff *to, skb_ext_find(from, SKB_EXT_MPTCP)); } -bool mptcp_sk_is_subflow(const struct sock *sk); - void mptcp_seq_show(struct seq_file *seq); #else @@ -140,6 +143,11 @@ static inline bool rsk_is_mptcp(const struct request_sock *req) return false; } +static inline bool rsk_drop_req(const struct request_sock *req) +{ + return false; +} + static inline void mptcp_parse_option(const struct sk_buff *skb, const unsigned char *ptr, int opsize, struct tcp_options_received *opt_rx) @@ -190,11 +198,6 @@ static inline bool mptcp_skb_can_collapse(const struct sk_buff *to, return true; } -static inline bool mptcp_sk_is_subflow(const struct sock *sk) -{ - return false; -} - static inline void mptcp_space(const struct sock *ssk, int *s, int *fs) { } static inline void mptcp_seq_show(struct seq_file *seq) { } #endif /* CONFIG_MPTCP */ |