From patchwork Tue Jul 25 18:34:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 13326921 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A36024163; Tue, 25 Jul 2023 18:34:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EB2FC433CB; Tue, 25 Jul 2023 18:34:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690310099; bh=QwCnG5+Z7TjpjUwNXP4jPD4RDLcuQH9RqoFnYbUu7zk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=WLf9j7bNRkk+C8wUwtTrglbCQ3trv6Z5i+Zv5RaFOU5WMeevBR/rtSw8yhsVhBBfw dyHdV38/mRlnvb23QCiusBcAHxk7+94J21m7kZ+lSCKX9ul+lGD2jsU8tePClT8+kU 7uUZTlvC9zwgqNmqilX6liw03A3rTxbKOTWeQYV1Gq0bYjMsuUFlEwObeKUaadu8rH HzNOje1HztlFsHcRZvusUrku48cZorlJlRHHffHCkw8FtJNVp5kW7a6BoJhaIv7KOY c6gJebLmPrmnh7iOuvGrKkEmuZzaN5+MZYRaplzGLZsYYviKfmpcQqo4S/1amIDrCQ p3rBM5xXuYBgQ== From: Mat Martineau Date: Tue, 25 Jul 2023 11:34:55 -0700 Subject: [PATCH net 1/2] selftests: mptcp: join: only check for ip6tables if needed Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230725-send-net-20230725-v1-1-6f60fe7137a9@kernel.org> References: <20230725-send-net-20230725-v1-0-6f60fe7137a9@kernel.org> In-Reply-To: <20230725-send-net-20230725-v1-0-6f60fe7137a9@kernel.org> To: Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Geliang Tang Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, stable@vger.kernel.org, Mat Martineau X-Mailer: b4 0.12.3 X-Patchwork-Delegate: kuba@kernel.org From: Matthieu Baerts If 'iptables-legacy' is available, 'ip6tables-legacy' command will be used instead of 'ip6tables'. So no need to look if 'ip6tables' is available in this case. Fixes: 0c4cd3f86a40 ("selftests: mptcp: join: use 'iptables-legacy' if available") Acked-by: Paolo Abeni Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index e6c9d5451c5b..3c2096ac97ef 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -162,9 +162,7 @@ check_tools() elif ! iptables -V &> /dev/null; then echo "SKIP: Could not run all tests without iptables tool" exit $ksft_skip - fi - - if ! ip6tables -V &> /dev/null; then + elif ! ip6tables -V &> /dev/null; then echo "SKIP: Could not run all tests without ip6tables tool" exit $ksft_skip fi From patchwork Tue Jul 25 18:34:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 13326922 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A3C72416D; Tue, 25 Jul 2023 18:35:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB7F5C43391; Tue, 25 Jul 2023 18:34:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690310099; bh=CeGxhrvZHThEsyTOEnPxSmGBdhmosALuz9k50d2C/S8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Kvfz9Lp36y6TgtEnpT2UiDb2SVPbspS7uCWkLDYO4E+KJQxrTWqGIcXNBmQPivAWM ziBT5ndTF+PXxGJ6xGn/A5R7909d5ZniwH7c2B2y06vvIBwo0SS4LtR9r5FqRR2Rrs 7q4LwCalSL0ts65kEPAgKyRR6lOv8MWevy5AbSYuo9g40G85HHbvcCP/BziFw7rHOe lBqjRRWbJ9z53w3kvjIbAnDOPxnEaCyTkS9dILyAO09CSGzIPCnEqkIT41shFRPwQt rjxg2ASmURXM4YPKcKZGX+tAPWtkX0s0pfqKgB056+fG9osNz9NX/mrKH4V9GzAcwh uvWg1CkfBNMeQ== From: Mat Martineau Date: Tue, 25 Jul 2023 11:34:56 -0700 Subject: [PATCH net 2/2] mptcp: more accurate NL event generation Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230725-send-net-20230725-v1-2-6f60fe7137a9@kernel.org> References: <20230725-send-net-20230725-v1-0-6f60fe7137a9@kernel.org> In-Reply-To: <20230725-send-net-20230725-v1-0-6f60fe7137a9@kernel.org> To: Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Geliang Tang Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, stable@vger.kernel.org, Mat Martineau X-Mailer: b4 0.12.3 X-Patchwork-Delegate: kuba@kernel.org From: Paolo Abeni Currently the mptcp code generate a "new listener" event even if the actual listen() syscall fails. Address the issue moving the event generation call under the successful branch. Fixes: f8c9dfbd875b ("mptcp: add pm listener events") Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau --- net/mptcp/protocol.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 3613489eb6e3..3317d1cca156 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -3723,10 +3723,9 @@ static int mptcp_listen(struct socket *sock, int backlog) if (!err) { sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); mptcp_copy_inaddrs(sk, ssock->sk); + mptcp_event_pm_listener(ssock->sk, MPTCP_EVENT_LISTENER_CREATED); } - mptcp_event_pm_listener(ssock->sk, MPTCP_EVENT_LISTENER_CREATED); - unlock: release_sock(sk); return err;