summaryrefslogtreecommitdiff
path: root/net/mptcp/protocol.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2021-04-16 17:10:40 -0700
committerDavid S. Miller <davem@davemloft.net>2021-04-16 17:10:40 -0700
commit474f459360399c5becfd0f189a8894e9e17ad3d3 (patch)
tree4ac2215add7c9db2a6b0ffcb02f1d63481c82b7b /net/mptcp/protocol.h
parent820dd7a244fe2d990d414172110f36cf5e8a936a (diff)
parent442279154c73bc681e5346bdd1270a628dfdfdc7 (diff)
Merge branch 'mptcp-fixes-and-tracepoints'
Mat Martineau says: ==================== mptcp: Fixes and tracepoints from the mptcp tree Here's one more batch of changes that we've tested out in the MPTCP tree. Patch 1 makes the MPTCP KUnit config symbol more consistent with other subsystems. Patch 2 fixes a couple of format specifiers in pr_debug()s Patches 3-7 add four helpful tracepoints for MPTCP. Patch 8 is a one-line refactor to use an available helper macro. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp/protocol.h')
-rw-r--r--net/mptcp/protocol.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index df269c26f145..edc0128730df 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -544,6 +544,18 @@ void mptcp_info2sockaddr(const struct mptcp_addr_info *info,
struct sockaddr_storage *addr,
unsigned short family);
+static inline bool mptcp_subflow_active(struct mptcp_subflow_context *subflow)
+{
+ struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
+
+ /* can't send if JOIN hasn't completed yet (i.e. is usable for mptcp) */
+ if (subflow->request_join && !subflow->fully_established)
+ return false;
+
+ /* only send if our side has not closed yet */
+ return ((1 << ssk->sk_state) & (TCPF_ESTABLISHED | TCPF_CLOSE_WAIT));
+}
+
static inline void mptcp_subflow_tcp_fallback(struct sock *sk,
struct mptcp_subflow_context *ctx)
{