From patchwork Thu Feb 10 01:25:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 12741096 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2E0DC433EF for ; Thu, 10 Feb 2022 01:25:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231953AbiBJBZQ (ORCPT ); Wed, 9 Feb 2022 20:25:16 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:50584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231842AbiBJBZO (ORCPT ); Wed, 9 Feb 2022 20:25:14 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E5C12654 for ; Wed, 9 Feb 2022 17:25:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644456316; x=1675992316; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ki68UMGj3/IhMfG82pNOMPf9Hgiw3imD98DaNC35q+Y=; b=TxLCnGSQPi9LMbvkIs0HKoIp+ot9Ku2P094iY06MAHd/rF9KKE96IYib duwKaIDZCl5Exvm57Ojm8LNYhEAlu8pCtvOv67S7okEVirAVhVnHI4QZW DHH9y3aA6eh481oqsEBsFKFRJnTxR/SXdxzTOUxl1zbyvoA5OR4+Xkrjy /xgnFJ4yO27Jmqd7T+x6+JxiVABeg3YuCut7khQnPI8g8aJBUXaKCvPRi 9W2VBjdah04FHP+drYxo8YXXKxJBEpHnB5UWid/XjE0mbS/cOxM5sew0M etG4A6mzdjI6tDABI6Jxp+OQRqG76bDT1gIsfOETjhifUFBd9jZKGf37n w==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="230029675" X-IronPort-AV: E=Sophos;i="5.88,357,1635231600"; d="scan'208";a="230029675" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 17:25:15 -0800 X-IronPort-AV: E=Sophos;i="5.88,357,1635231600"; d="scan'208";a="526263244" Received: from mjmartin-desk2.amr.corp.intel.com (HELO mjmartin-desk2.intel.com) ([10.251.22.101]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 17:25:15 -0800 From: Mat Martineau To: netdev@vger.kernel.org Cc: Matthieu Baerts , davem@davemloft.net, kuba@kernel.org, liyonglong@chinatelecom.cn, mptcp@lists.linux.dev, Paolo Abeni , Mat Martineau Subject: [PATCH net 1/2] selftests: mptcp: add missing join check Date: Wed, 9 Feb 2022 17:25:07 -0800 Message-Id: <20220210012508.226880-2-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220210012508.226880-1-mathew.j.martineau@linux.intel.com> References: <20220210012508.226880-1-mathew.j.martineau@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Matthieu Baerts This function also writes the name of the test with its ID, making clear a new test has been executed. Without that, the ADD_ADDR results from this test was appended at the end of the previous test causing confusions. Especially when the second test was failing, we had: 17 signal invalid addresses syn[ ok ] - synack[ ok ] - ack[ ok ] add[ ok ] - echo [ ok ] add[fail] got 2 ADD_ADDR[s] expected 3 In fact, this 17th test was OK but not the 18th one. Now we have: 17 signal invalid addresses syn[ ok ] - synack[ ok ] - ack[ ok ] add[ ok ] - echo [ ok ] 18 signal addresses race test syn[fail] got 2 JOIN[s] syn expected 3 - synack[fail] got 2 JOIN[s] synack expected - ack[fail] got 2 JOIN[s] ack expected 3 add[fail] got 2 ADD_ADDR[s] expected 3 Fixes: 33c563ad28e3 ("selftests: mptcp: add_addr and echo race test") Reported-by: Paolo Abeni Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index b8bdbec0cf69..c0801df15f54 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -1159,6 +1159,7 @@ signal_address_tests() ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags signal ip netns exec $ns2 ./pm_nl_ctl add 10.0.4.2 flags signal run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr "signal addresses race test" 3 3 3 # the server will not signal the address terminating # the MPC subflow From patchwork Thu Feb 10 01:25:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 12741097 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54D77C433FE for ; Thu, 10 Feb 2022 01:25:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231982AbiBJBZS (ORCPT ); Wed, 9 Feb 2022 20:25:18 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:50586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231751AbiBJBZO (ORCPT ); Wed, 9 Feb 2022 20:25:14 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DAC1205DF; Wed, 9 Feb 2022 17:25:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644456316; x=1675992316; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=G0+MAlrnsf/greE/vEdVzWDF/aTaDZ7Y2QTg6LX8frg=; b=ZP0dsq2Ytlr/Sj5TMQW2wheutX4axLG4MBzvFU0Fx5GBzxfehQjNsSJN 2sk30YoSXk5t+sYUfgYp9BxO0qpcgFkI1oj7+rKTK04EpfvTEAbmF4nEV n9C376bRIWG6Zc/uBdMWIiWc2+Pt2dxBbqeKemsJEAitlFJ/4Ihepmptn 2aYNZPqJD6V256JMP5suQqdtUXdcwxR+jeg42N45TJApZ0bnuyEJMmtr1 lrPIizQlcM9GAxDNBYkVzZR2FvY4V+q1fUEH+LQOWvY7VdELAcR+4NP3p 6FoJj9NlnrCcez/3hM+uZa7doUgyFXWknGJafvEA426ULzEhUyl6GvRFu Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="230029677" X-IronPort-AV: E=Sophos;i="5.88,357,1635231600"; d="scan'208";a="230029677" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 17:25:15 -0800 X-IronPort-AV: E=Sophos;i="5.88,357,1635231600"; d="scan'208";a="526263247" Received: from mjmartin-desk2.amr.corp.intel.com (HELO mjmartin-desk2.intel.com) ([10.251.22.101]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 17:25:15 -0800 From: Mat Martineau To: netdev@vger.kernel.org Cc: Kishen Maloor , davem@davemloft.net, kuba@kernel.org, matthieu.baerts@tessares.net, mptcp@lists.linux.dev, stable@vger.kernel.org, Geliang Tang , Mat Martineau Subject: [PATCH net 2/2] mptcp: netlink: process IPv6 addrs in creating listening sockets Date: Wed, 9 Feb 2022 17:25:08 -0800 Message-Id: <20220210012508.226880-3-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220210012508.226880-1-mathew.j.martineau@linux.intel.com> References: <20220210012508.226880-1-mathew.j.martineau@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Kishen Maloor This change updates mptcp_pm_nl_create_listen_socket() to create listening sockets bound to IPv6 addresses (where IPv6 is supported). Cc: stable@vger.kernel.org Fixes: 1729cf186d8a ("mptcp: create the listening socket for new port") Acked-by: Geliang Tang Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau --- net/mptcp/pm_netlink.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 782b1d452269..356f596e2032 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -925,6 +925,7 @@ static int mptcp_pm_nl_append_new_local_addr(struct pm_nl_pernet *pernet, static int mptcp_pm_nl_create_listen_socket(struct sock *sk, struct mptcp_pm_addr_entry *entry) { + int addrlen = sizeof(struct sockaddr_in); struct sockaddr_storage addr; struct mptcp_sock *msk; struct socket *ssock; @@ -949,8 +950,11 @@ static int mptcp_pm_nl_create_listen_socket(struct sock *sk, } mptcp_info2sockaddr(&entry->addr, &addr, entry->addr.family); - err = kernel_bind(ssock, (struct sockaddr *)&addr, - sizeof(struct sockaddr_in)); +#if IS_ENABLED(CONFIG_MPTCP_IPV6) + if (entry->addr.family == AF_INET6) + addrlen = sizeof(struct sockaddr_in6); +#endif + err = kernel_bind(ssock, (struct sockaddr *)&addr, addrlen); if (err) { pr_warn("kernel_bind error, err=%d", err); goto out;