From patchwork Mon Nov 11 11:28:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Abeni X-Patchwork-Id: 1192874 X-Patchwork-Delegate: matthieu.baerts@tessares.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.01.org (client-ip=2001:19d0:306:5::1; helo=ml01.01.org; envelope-from=mptcp-bounces@lists.01.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="fSa4Vmh6"; dkim-atps=neutral Received: from ml01.01.org (ml01.01.org [IPv6:2001:19d0:306:5::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47BTDN5y91z9sR4 for ; Mon, 11 Nov 2019 22:29:24 +1100 (AEDT) Received: from new-ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 67396100EA52E; Mon, 11 Nov 2019 03:31:12 -0800 (PST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=207.211.31.120; helo=us-smtp-1.mimecast.com; envelope-from=pabeni@redhat.com; receiver= Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7C1A4100EA63E for ; Mon, 11 Nov 2019 03:31:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573471753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xMzMFClVjhImn8mCraaPjnAfDH4kurxcJfnH3YX7phI=; b=fSa4Vmh64rUi86GSElSOMrCO55hsNtme9k6V0Nw3wYgBAr4e20u5D0RcyZQjwIUjsc2TBh 2QnTSU0Mbdepl9YVIpGstVybCaSvusKdU/o5ZVHyBQwnsrgms5aPpY+qJ+Ptj9MtfpmgXb BkRQ60UzgObfcmq1IQRNMGagaFZhN9U= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-25-aRC_DgA1Ozu3dWRSi4TRXg-1; Mon, 11 Nov 2019 06:29:12 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DDE35107ACC4 for ; Mon, 11 Nov 2019 11:29:11 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-119.ams2.redhat.com [10.36.117.119]) by smtp.corp.redhat.com (Postfix) with ESMTP id 533E35D72C for ; Mon, 11 Nov 2019 11:29:11 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.01.org Date: Mon, 11 Nov 2019 12:28:58 +0100 Message-Id: <823b8a78b336ac52165a91c53d92064db248d825.1573471403.git.pabeni@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: aRC_DgA1Ozu3dWRSi4TRXg-1 X-Mimecast-Spam-Score: 0 Message-ID-Hash: AUDXFCZ467ID7RVG65U67SI443DBBUG2 X-Message-ID-Hash: AUDXFCZ467ID7RVG65U67SI443DBBUG2 X-MailFrom: pabeni@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.1.1 Precedence: list Subject: [MPTCP] [PATCH 1/4] mptcp: drop most of mptcp_init_sock() impl List-Id: Discussions regarding MPTCP upstreaming Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Will be dropped anyway by laters patches and apparently introduces a mem leak (currently plugged by "mptcp: new sysctl to control the activation per NS") Squash-to: "mptcp: Add MPTCP socket stubs" Signed-off-by: Paolo Abeni --- net/mptcp/protocol.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index a4efa06e43d2..40290bfd0717 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -39,18 +39,7 @@ static int mptcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, static int mptcp_init_sock(struct sock *sk) { - struct mptcp_sock *msk = mptcp_sk(sk); - struct net *net = sock_net(sk); - struct socket *sf; - int err; - - err = sock_create_kern(net, PF_INET, SOCK_STREAM, IPPROTO_TCP, &sf); - if (!err) { - pr_debug("subflow=%p", sf->sk); - msk->subflow = sf; - } - - return err; + return 0; } static void mptcp_close(struct sock *sk, long timeout) From patchwork Mon Nov 11 11:28:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Abeni X-Patchwork-Id: 1192873 X-Patchwork-Delegate: matthieu.baerts@tessares.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.01.org (client-ip=2001:19d0:306:5::1; helo=ml01.01.org; envelope-from=mptcp-bounces@lists.01.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="fq3kyMxt"; dkim-atps=neutral Received: from ml01.01.org (ml01.01.org [IPv6:2001:19d0:306:5::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47BTDN0q20z9sQw for ; Mon, 11 Nov 2019 22:29:23 +1100 (AEDT) Received: from new-ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6FA84100EA535; Mon, 11 Nov 2019 03:31:14 -0800 (PST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=207.211.31.120; helo=us-smtp-1.mimecast.com; envelope-from=pabeni@redhat.com; receiver= Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1589F100EA52C for ; Mon, 11 Nov 2019 03:31:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573471755; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CEpB8Z4fooGEsIUBh4jxQH3aeXATkPjqqeP4X8JIjHQ=; b=fq3kyMxt9UpwN6f1fUp6DaWB2L82G/tq2uUcOGQ4ThaxcDNGtZL7WTfRiGMaohDv0iOG16 3zVy6an6wqyNExYVHUfyk05VLBUNZHbSkOvBMnjp9/6H+Xq+m+GrecfYmBj5+0DVoufB3d vBo0KGV8R5tx9fDF4S4kPlx8cSGDP+M= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-325-2Tht1jTYNymaT3Sq6lmuCw-1; Mon, 11 Nov 2019 06:29:14 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8623D107ACC4 for ; Mon, 11 Nov 2019 11:29:13 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-119.ams2.redhat.com [10.36.117.119]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF8705D77F for ; Mon, 11 Nov 2019 11:29:12 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.01.org Date: Mon, 11 Nov 2019 12:28:59 +0100 Message-Id: <11ddd259a602f020805abbc12ed400c22f69fed0.1573471424.git.pabeni@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: 2Tht1jTYNymaT3Sq6lmuCw-1 X-Mimecast-Spam-Score: 0 Message-ID-Hash: 7AJAOYYPMEZOVA7R7Y5V2TNBRR5AECX6 X-Message-ID-Hash: 7AJAOYYPMEZOVA7R7Y5V2TNBRR5AECX6 X-MailFrom: pabeni@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.1.1 Precedence: list Subject: [MPTCP] [PATCH 2/4] mptcp: use customary name for tcp_sock variable List-Id: Discussions regarding MPTCP upstreaming Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: The variable is currently renamed in later patch "mptcp: Handle MP_CAPABLE options for outgoing connections", let's do it here instead Squash-to: mptcp: Associate MPTCP context with TCP socket Signed-off-by: Paolo Abeni --- net/mptcp/subflow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index c1800f94437d..29d4d1cb284e 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -63,8 +63,8 @@ static struct mptcp_subflow_context *subflow_create_ctx(struct sock *sk, static int subflow_ulp_init(struct sock *sk) { - struct tcp_sock *tsk = tcp_sk(sk); struct mptcp_subflow_context *ctx; + struct tcp_sock *tp = tcp_sk(sk); int err = 0; /* disallow attaching ULP to a socket unless it has been @@ -83,7 +83,7 @@ static int subflow_ulp_init(struct sock *sk) pr_debug("subflow=%p", ctx); - tsk->is_mptcp = 1; + tp->is_mptcp = 1; out: return err; } From patchwork Mon Nov 11 11:29:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Abeni X-Patchwork-Id: 1192875 X-Patchwork-Delegate: matthieu.baerts@tessares.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.01.org (client-ip=2001:19d0:306:5::1; helo=ml01.01.org; envelope-from=mptcp-bounces@lists.01.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="GGY6o7Mx"; dkim-atps=neutral Received: from ml01.01.org (ml01.01.org [IPv6:2001:19d0:306:5::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47BTDP0dPLz9sR6 for ; Mon, 11 Nov 2019 22:29:24 +1100 (AEDT) Received: from new-ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 83BAE100EA542; Mon, 11 Nov 2019 03:31:17 -0800 (PST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=207.211.31.120; helo=us-smtp-1.mimecast.com; envelope-from=pabeni@redhat.com; receiver= Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 51746100EA53E for ; Mon, 11 Nov 2019 03:31:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573471758; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L8Kj8STs06bIujDMzGauA4MBUICKHMadYoQaZqVfiqQ=; b=GGY6o7MxuPpwfL4WH9dbxR2GkH36fUqZ8qRP/ViIskQW3qg/T/oDyNeXH8r9iGIFHmVJ9w 4maYWAkxk99dKpFRpBg66zF1NRUx9zoavj3sEz9aAyQtVaa8pUwGZUASDajEtw+rzC/fWU eDSngQ/xK/huB+UuvQvNvbLxxd/+cF4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-69-sAWWblqSOH6ot_zJXcbwmQ-1; Mon, 11 Nov 2019 06:29:17 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E00C3801E76 for ; Mon, 11 Nov 2019 11:29:16 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-119.ams2.redhat.com [10.36.117.119]) by smtp.corp.redhat.com (Postfix) with ESMTP id 559EB62965 for ; Mon, 11 Nov 2019 11:29:16 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.01.org Date: Mon, 11 Nov 2019 12:29:01 +0100 Message-Id: <7b21ca56785decb50da4b6432009bf039add80fb.1573471458.git.pabeni@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: sAWWblqSOH6ot_zJXcbwmQ-1 X-Mimecast-Spam-Score: 0 Message-ID-Hash: R53C3IKZCTADTSBYRPK5IXZIE2XCWU26 X-Message-ID-Hash: R53C3IKZCTADTSBYRPK5IXZIE2XCWU26 X-MailFrom: pabeni@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.1.1 Precedence: list Subject: [MPTCP] [PATCH 4/4] mptcp: init new_ctx->icsk_af_ops() in subflow_ulp_clone() List-Id: Discussions regarding MPTCP upstreaming Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Currently inited in "mptcp: Add key generation and token tree", causing transient build failure, move here for consistency and fix build issue Squash-to: "mptcp: Create SUBFLOW socket for incoming connections" Signed-off-by: Paolo Abeni --- net/mptcp/subflow.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 5c0594d09cc5..869010587df4 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -212,6 +212,7 @@ static void subflow_ulp_clone(const struct request_sock *req, const gfp_t priority) { struct mptcp_subflow_request_sock *subflow_req = mptcp_subflow_rsk(req); + struct mptcp_subflow_context *old_ctx = mptcp_subflow_ctx(newsk); struct mptcp_subflow_context *new_ctx; /* newsk->sk_socket is NULL at this point */ @@ -221,6 +222,7 @@ static void subflow_ulp_clone(const struct request_sock *req, new_ctx->conn = NULL; new_ctx->conn_finished = 1; + new_ctx->icsk_af_ops = old_ctx->icsk_af_ops; if (subflow_req->mp_capable) { new_ctx->mp_capable = 1;