From patchwork Mon Feb 17 18:28:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Abeni X-Patchwork-Id: 1239497 X-Patchwork-Delegate: pabeni@redhat.com 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.a=rsa-sha256 header.s=mimecast20190719 header.b=A0Ydc08v; 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 48Lsv74N73z9sRJ for ; Tue, 18 Feb 2020 05:28:51 +1100 (AEDT) Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id F179910FC3593; Mon, 17 Feb 2020 10:32:06 -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 86F5310FC3585 for ; Mon, 17 Feb 2020 10:32:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581964126; 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=8sD5ChUxX/Uvc2Qx8uPyiUd4FBejHabB1H5ZOhF1i1c=; b=A0Ydc08vz93+7+/aoKL1586qBg/IaA9wp8hgFe4PWyc+1tDdtZ1Fy5l9APaNdj5lYyVXB2 3M06RhriNJ4gjOPUpS9LMHwGcuMH94/5nOE8wFBMC5xgiPyiMOXfSf0m/K3fMprO1C6Kaz 4WaCnefaYbFACnOpSd04BLcqqWf6r1M= 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-255-18_mEZg9PCqMbAVlvd7N1Q-1; Mon, 17 Feb 2020 13:28:45 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 50B78107ACC5 for ; Mon, 17 Feb 2020 18:28:44 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-153.ams2.redhat.com [10.36.116.153]) by smtp.corp.redhat.com (Postfix) with ESMTP id B172885735 for ; Mon, 17 Feb 2020 18:28:43 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.01.org Date: Mon, 17 Feb 2020 19:28:29 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: 18_mEZg9PCqMbAVlvd7N1Q-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: 2BB6FLFFUXXHNWF3AKYZVZSPWCCCMP6F X-Message-ID-Hash: 2BB6FLFFUXXHNWF3AKYZVZSPWCCCMP6F 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 3/7] Squash-to: "mptcp: Add handling of incoming MP_JOIN requests" List-Id: Discussions regarding MPTCP upstreaming Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Update mptcp_pm_get_local_id() callers to new API. Hook mptcp_pm_subflow_established() when MP_JOIN completes successfully Signed-off-by: Paolo Abeni --- net/mptcp/options.c | 7 +++++-- net/mptcp/subflow.c | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 43bfeb3fa753..c2e0576065b6 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -128,7 +128,6 @@ void mptcp_parse_option(const struct sk_buff *skb, const unsigned char *ptr, } break; - case MPTCPOPT_DSS: pr_debug("DSS"); ptr++; @@ -565,8 +564,12 @@ static bool check_fourth_ack(struct mptcp_subflow_context *subflow, TCP_SKB_CB(skb)->seq != subflow->ssn_offset + 1)) return true; - if (mp_opt->use_ack) + if (mp_opt->use_ack) { subflow->fourth_ack = 1; + if (subflow->mp_join) + mptcp_pm_subflow_established(mptcp_sk(subflow->conn), + subflow); + } if (subflow->can_ack) return true; diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index a8dedbd8d458..5710b439e418 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -55,6 +55,7 @@ static bool subflow_token_join_request(struct request_sock *req, struct mptcp_subflow_request_sock *subflow_req = mptcp_subflow_rsk(req); u8 hmac[MPTCPOPT_HMAC_LEN]; struct mptcp_sock *msk; + int local_id; msk = mptcp_token_get_sock(subflow_req->token); if (!msk) { @@ -63,10 +64,12 @@ static bool subflow_token_join_request(struct request_sock *req, return false; } - if (mptcp_pm_get_local_id(req, (struct sock *)msk, skb)) { + local_id = mptcp_pm_get_local_id(msk, (struct sock_common *)req); + if (local_id < 0) { sock_put((struct sock *)msk); return false; } + subflow_req->local_id = local_id; get_random_bytes(&subflow_req->local_nonce, sizeof(u32));