From patchwork Mon Jun 17 08:33:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 805818 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 558C8187331; Mon, 17 Jun 2024 08:33:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718613234; cv=none; b=UfMWiripVWMLzL/DgJbPwx/cvXrCoIM0nwFoPnfKdTTd0CWGFgFcdxAbhA/b3NUS0yYHsFTEgRLX4J3xGbxnGvefJGVLxQofQe1UKFbC2FhoQFjdP17bu8aSgl3PlxtfZeyKY07Uz5U6dfWsz4nJfKyt2yRWKbGDQDMJZvVDm/c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718613234; c=relaxed/simple; bh=QDeYipd1o0V9wiiSdEf3dBRvIuDzcvSCSFdjltKsxtY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PLZ68go6TAHH1o5+D3HJPKdrYOsUw/bikDmKtvD+73+heLCmn0V9I509jphs28xwLXpapKKXaekipenDdNIQ6/CBD6XkzdbiSedNcrihuasxEDCfLRU//gmCmeGYJiAFD1fMleXLq94VuXGsVvJo1rdi2R6NASgkWY8tPTT2LDw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=js2CZoD+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="js2CZoD+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54F82C4AF1A; Mon, 17 Jun 2024 08:33:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718613234; bh=QDeYipd1o0V9wiiSdEf3dBRvIuDzcvSCSFdjltKsxtY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=js2CZoD+Dap8Z7pwnWPMwVBO8JBzbTrRjHTPipY2pFRGZofw8XTsbObW2uCVFopE7 bX4BIUOp0LOa7lJOA7GTJ/R2kk5fqnPIgXJtHIbSySH4AfKBUSFeXOaR/lMHbq11CJ h/6+v++VzgOAuIcSMmHduHhKXnm3Kq1v7+vuOJqI5+Kj/aGP6YWkBJRerkRjSDUKg6 lnjKR8UBXmEoRnUZhOCe5ueeBbukagzw/A6u/9HKz5loqlLpFiqrBMIjLHxHYzwx3I uGtZGcek8pos9kRtaacZ+gqNoFUrW+K+lEDZnK/3lF8iQUWpehLRWNzPwEhhVho26h FNybk9X2yMk/g== From: Geliang Tang To: Andrii Nakryiko , Eduard Zingerman , Mykola Lysenko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan Cc: Geliang Tang , bpf@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH mptcp-next v3 5/6] selftests/bpf: Use start_server_str in mptcp Date: Mon, 17 Jun 2024 16:33:10 +0800 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Geliang Tang Since start_server_str() is added now, it can be used in mptcp.c in start_mptcp_server() instead of using helpers make_sockaddr() and start_server_addr() to simplify the code. Signed-off-by: Geliang Tang Acked-by: Eduard Zingerman --- tools/testing/selftests/bpf/prog_tests/mptcp.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c index 274d2e033e39..d2ca32fa3b21 100644 --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c @@ -89,13 +89,8 @@ static int start_mptcp_server(int family, const char *addr_str, __u16 port, .timeout_ms = timeout_ms, .proto = IPPROTO_MPTCP, }; - struct sockaddr_storage addr; - socklen_t addrlen; - if (make_sockaddr(family, addr_str, port, &addr, &addrlen)) - return -1; - - return start_server_addr(SOCK_STREAM, &addr, addrlen, &opts); + return start_server_str(family, SOCK_STREAM, addr_str, port, &opts); } static int verify_tsk(int map_fd, int client_fd)