netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next v2] selftests: Fix the if conditions of in test_extra_filter()
@ 2022-09-23  7:02 Wang Yufen
  2022-09-27  9:10 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Yufen @ 2022-09-23  7:02 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, shuah
  Cc: netdev, linux-kselftest, linux-kernel, bpf

The socket 2 bind the addr in use, bind should fail with EADDRINUSE. So
if bind success or errno != EADDRINUSE, testcase should be failed.

Fixes: 3ca8e4029969 ("soreuseport: BPF selection functional test")
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
---
v1 -> v2: add a Fixes tag
 tools/testing/selftests/net/reuseport_bpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/reuseport_bpf.c b/tools/testing/selftests/net/reuseport_bpf.c
index 072d709c..65aea27 100644
--- a/tools/testing/selftests/net/reuseport_bpf.c
+++ b/tools/testing/selftests/net/reuseport_bpf.c
@@ -328,7 +328,7 @@ static void test_extra_filter(const struct test_params p)
 	if (bind(fd1, addr, sockaddr_size()))
 		error(1, errno, "failed to bind recv socket 1");
 
-	if (!bind(fd2, addr, sockaddr_size()) && errno != EADDRINUSE)
+	if (!bind(fd2, addr, sockaddr_size()) || errno != EADDRINUSE)
 		error(1, errno, "bind socket 2 should fail with EADDRINUSE");
 
 	free(addr);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [net-next v2] selftests: Fix the if conditions of in test_extra_filter()
  2022-09-23  7:02 [net-next v2] selftests: Fix the if conditions of in test_extra_filter() Wang Yufen
@ 2022-09-27  9:10 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-09-27  9:10 UTC (permalink / raw)
  To: Wang Yufen
  Cc: davem, edumazet, kuba, pabeni, shuah, netdev, linux-kselftest,
	linux-kernel, bpf

Hello:

This patch was applied to netdev/net.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Fri, 23 Sep 2022 15:02:37 +0800 you wrote:
> The socket 2 bind the addr in use, bind should fail with EADDRINUSE. So
> if bind success or errno != EADDRINUSE, testcase should be failed.
> 
> Fixes: 3ca8e4029969 ("soreuseport: BPF selection functional test")
> Signed-off-by: Wang Yufen <wangyufen@huawei.com>
> ---
> v1 -> v2: add a Fixes tag
>  tools/testing/selftests/net/reuseport_bpf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [net-next,v2] selftests: Fix the if conditions of in test_extra_filter()
    https://git.kernel.org/netdev/net/c/bc7a31984489

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-27  9:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-23  7:02 [net-next v2] selftests: Fix the if conditions of in test_extra_filter() Wang Yufen
2022-09-27  9:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).