projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ea64cdf
)
selftests: Fix the if conditions of in test_extra_filter()
author
Wang Yufen
<wangyufen@huawei.com>
Fri, 23 Sep 2022 07:02:37 +0000
(15:02 +0800)
committer
Paolo Abeni
<pabeni@redhat.com>
Tue, 27 Sep 2022 09:00:02 +0000
(11:00 +0200)
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>
Link:
https://lore.kernel.org/r/1663916557-10730-1-git-send-email-wangyufen@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/testing/selftests/net/reuseport_bpf.c
patch
|
blob
|
history
diff --git
a/tools/testing/selftests/net/reuseport_bpf.c
b/tools/testing/selftests/net/reuseport_bpf.c
index 072d709c96b482e57bca41aa96165faeb4ecd4e8..65aea27d761cacca392ebb3696e360abb1389935 100644
(file)
--- 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);