@@ -342,6 +342,14 @@ static int mptcp_stream_connect(struct socket *sock, struct sockaddr *uaddr,
if (IS_ERR(ssock))
return PTR_ERR(ssock);
+#ifdef CONFIG_TCP_MD5SIG
+ /* no MPTCP if MD5SIG is enabled on this socket or we may run out of
+ * TCP option space.
+ */
+ if (rcu_access_pointer(tcp_sk(ssock->sk)->md5sig_info))
+ mptcp_subflow_ctx(ssock->sk)->request_mptcp = 0;
+#endif
+
err = ssock->ops->connect(ssock, uaddr, addr_len, flags);
sock_put(ssock->sk);
return err;
@@ -30,6 +30,14 @@ static void subflow_init_req(struct request_sock *req,
subflow_req->mp_capable = 0;
+#ifdef CONFIG_TCP_MD5SIG
+ /* no MPTCP if MD5SIG is enabled on this socket or we may run out of
+ * TCP option space.
+ */
+ if (rcu_access_pointer(tcp_sk(sk_listener)->md5sig_info))
+ return;
+#endif
+
if (rx_opt.mptcp.mp_capable && listener->request_mptcp) {
subflow_req->mp_capable = 1;
if (rx_opt.mptcp.version >= listener->request_version)
Squash-to: mptcp: Create SUBFLOW socket for incoming connections Signed-off-by: Paolo Abeni <pabeni@redhat.com> --- v1 -> v2 - fix comment typo --- net/mptcp/protocol.c | 8 ++++++++ net/mptcp/subflow.c | 8 ++++++++ 2 files changed, 16 insertions(+)