From patchwork Wed Jun 12 14:41:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 803708 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 0B3B017DE37; Wed, 12 Jun 2024 14:41:30 +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=1718203292; cv=none; b=Jt9GRWcCnlDJqK3JeAzr9egfthi7KoLMJn9tLfGggx8hCgZxI092V2muxHEyMYeKZpxV03iIc77RFEvuXuvUbx9g8oQRVxdxzbpUQ1OhnWw+6bEnsp6JNRhgkJ6oRBN71aLf4j0lfSD86TXS+C3vrADnf9qaHS1N/3UF92LeVN8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718203292; c=relaxed/simple; bh=QDeYipd1o0V9wiiSdEf3dBRvIuDzcvSCSFdjltKsxtY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pV73BkO1lhyvet8+ou3W3GMN1ZjfoRDst9ZPjsLl+yjc4rSaTi3lLMQfMzlejUu+8Q5zRsLfq0CyX1cAIgMTGhTMBKqf4gasxbSxEdWxfi9GepTNV5jSEuaIvhbDuSnN5AJSyiAgFMrI5C1MkINbN+TUht9fOLs4+jTVsQebKj0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Lu7UmvED; 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="Lu7UmvED" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5095C3277B; Wed, 12 Jun 2024 14:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718203290; bh=QDeYipd1o0V9wiiSdEf3dBRvIuDzcvSCSFdjltKsxtY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lu7UmvED/y1SwgogW42zHKJGREBVJYgvhOipuuogJpeB1RzS5OojTK0A8DoO7OoMw x9oEJkb9nSasx2jau93ZECb2QgPZBWCtCPEQFATP8Kyf/P1wP7MPFmNboanAHNOWBu BCgsQHmXLCciWf78IewcLjMq/cyi5fm1HQ7ODILjFeRLhVaiPXFkr2WOb8E/sjGAVv UhRSmrBvq9ooInlW51Dj/CbIH9JTnJ4JxyNUNTWThEFmwQfCZYf7Lx/PMqdw/gfOlr 2quSqIwFJvHjcA6JSpCj0fFM8+ehFpzlkTrR9Qv0XfThfnslWjliUknZMen8jY2xr8 q6Nvj1pbqHIow== 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 v2 3/4] selftests/bpf: Use start_server_str in mptcp Date: Wed, 12 Jun 2024 22:41:05 +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)