Skip to content
Commit 8c0be063 authored by Felix Maurer's avatar Felix Maurer Committed by Andrii Nakryiko
Browse files

selftests: bpf: Fix bind on used port



The bind_perm BPF selftest failed when port 111/tcp was already in use
during the test. To fix this, the test now runs in its own network name
space.

To use unshare, it is necessary to reorder the includes. The style of
the includes is adapted to be consistent with the other prog_tests.

v2: Replace deprecated CHECK macro with ASSERT_OK

Fixes: 8259fdeb ("selftests/bpf: Verify that rebinding to port < 1024 from BPF works")
Signed-off-by: default avatarFelix Maurer <fmaurer@redhat.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Reviewed-by: default avatarJakub Sitnicki <jakub@cloudflare.com>
Link: https://lore.kernel.org/bpf/551ee65533bb987a43f93d88eaf2368b416ccd32.1642518457.git.fmaurer@redhat.com
parent 38f033a1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment