From patchwork Tue Jun 11 01:59:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13692744 X-Patchwork-Delegate: bpf@iogearbox.net 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 37211AD21; Tue, 11 Jun 2024 02:00:29 +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=1718071230; cv=none; b=sdUrqZ9Osfmor/cHgnaGapCQz+TOM9ELASqUXLTqU9rvuYqWtVmV8HanNYRL6gxBfMSK6x3iFtul2Zwrdy/wt4SOvujoJcGfy0eQE7kQphqRPrXCwKdeNZufcRLzhFblnwb2UbaLvL+z6gkMBtJnnk7xgauABczdpkW43q3sqAU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718071230; c=relaxed/simple; bh=EOuXoUhyZErUAKP/jyrB94SzTJRRLAYfeiAWVUX3QGA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ee3DiIthH1LVccMYlaY6icoj/367l4Fnp2vmd8dVFR3hlYOL59Dgh1ANA0aO7CYS16bUiN62zzOTaXXMpxPxn01sY4Pn0OFCVjc9261b2/LW+eD0DKKKKzg4p4iv395/jIFbPLZuDGRI511JZ9qQEnztazfqhLhpwxCjh/q5gH8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BC10WO+K; 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="BC10WO+K" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09F89C2BBFC; Tue, 11 Jun 2024 02:00:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718071229; bh=EOuXoUhyZErUAKP/jyrB94SzTJRRLAYfeiAWVUX3QGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BC10WO+KtQ0Q1WUUr768cLfJ/GzaRE5db7X5iBHx0yiTgbEa8fqAsb43N+0GFwJnp Fcig0JMy6Aw1bfBjZZVeaMYGzQynGkee6fE6TXP2HVVoYuk/FHrhT5pZJNygGafEE2 olL2gO8sDWdxn8df6hfBIVHaGyVbaTTzet3XrsfOqO3nG0mwGTF7U+Pfb8eskRwcCj uqVQeNux37dikGj87vNJQbjLUe06sDYXyaUn4jTaqagbbL/IA7XolsNYckJ1HQvTnT UQd/NT0u5Dnzy0qbb8AW4s4CPqi3H69QPxktMZZ7VXnM1cpFc3LFMZQYCls27Q/IH8 ObiPNbsG2M7+A== 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 bpf-next 4/5] selftests/bpf: Use start_server_str in mptcp Date: Tue, 11 Jun 2024 09:59:37 +0800 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net 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 4472aa404da0..00f63f3f19f4 100644 --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c @@ -104,13 +104,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)