From: Mat Martineau <mathew.j.martineau at linux.intel.com>
To: mptcp at lists.01.org
Subject: [MPTCP] Re: [RFC PATCH 1/4] Squash-to: "mptcp: Handle MP_CAPABLE options for outgoing connections"
Date: Fri, 20 Dec 2019 13:43:05 -0800 [thread overview]
Message-ID: <alpine.OSX.2.21.1912201334300.52347@mkavai-mobl.amr.corp.intel.com> (raw)
In-Reply-To: a91929d1327d846a715ef6655311acae49285ae5.1576867317.git.pabeni@redhat.com
[-- Attachment #1: Type: text/plain, Size: 1883 bytes --]
On Fri, 20 Dec 2019, Paolo Abeni wrote:
> After upstream feedback, I just noticed that we actually
> don't clear the is_mptcp field on clone allocation failure.
>
> Do that and additionally don't allocate at all the subflow if MPC handshake
> failed.
>
> Note: we need to update accordingly accept on later patch
>
> Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
> ---
> net/mptcp/subflow.c | 20 ++++++++------------
> 1 file changed, 8 insertions(+), 12 deletions(-)
>
> diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
> index b9aca17b0b91..7dd8733dc72a 100644
> --- a/net/mptcp/subflow.c
> +++ b/net/mptcp/subflow.c
> @@ -262,23 +262,19 @@ static void subflow_ulp_clone(const struct request_sock *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 */
> - new_ctx = subflow_create_ctx(newsk, priority);
> - if (!new_ctx)
> + if (!subflow_req->mp_capable ||
> + (new_ctx = subflow_create_ctx(newsk, priority)) == NULL) {
> + tcp_sk(newsk)->is_mptcp = 0;
> return;
> + }
>
> new_ctx->conn = NULL;
subflow_create_ctx() uses kzalloc, so we can also drop this initialization
of new_ctx->conn.
> 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;
> - new_ctx->fourth_ack = 1;
> - new_ctx->remote_key = subflow_req->remote_key;
> - new_ctx->local_key = subflow_req->local_key;
> - } else {
> - tcp_sk(newsk)->is_mptcp = 0;
> - }
> + new_ctx->mp_capable = 1;
> + new_ctx->fourth_ack = 1;
> + new_ctx->remote_key = subflow_req->remote_key;
> + new_ctx->local_key = subflow_req->local_key;
> }
>
> static struct tcp_ulp_ops subflow_ulp_ops __read_mostly = {
> --
> 2.21.0
--
Mat Martineau
Intel
next reply other threads:[~2019-12-20 21:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-20 21:43 Mat Martineau [this message]
2019-12-21 1:05 [MPTCP] Re: [RFC PATCH 1/4] Squash-to: "mptcp: Handle MP_CAPABLE options for outgoing connections" Florian Westphal
2020-01-03 18:29 Paolo Abeni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.OSX.2.21.1912201334300.52347@mkavai-mobl.amr.corp.intel.com \
--to=unknown@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.