]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests: net: run reuseport in an isolated netns
authorAleksei Oladko <aleksey.oladko@virtuozzo.com>
Sat, 21 Mar 2026 21:59:05 +0000 (21:59 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 24 Mar 2026 02:58:29 +0000 (19:58 -0700)
commita897e194c475d5e0d141e27df600dd43962308f1
treeed9357be7f969459741c94e709f7c02bbc5ad506
parentef94e96eaedc63c75d462d0e4dcbea0f6fbd6c74
selftests: net: run reuseport in an isolated netns

The reuseport_* tests (bpf, bpf_cpu, bpf_numa, dualstack) currently use
a fixed port range. This can cause intermittent test failures when the
ports are already in use by other services:

  failed to bind receive socket: Address already in use

To avoid conflicts, run these tests in separate network namespaces using
unshare. Each test now has its own isolated network stack, preventing
port collisions with the host services.

Signed-off-by: Aleksei Oladko <aleksey.oladko@virtuozzo.com>
Link: https://patch.msgid.link/20260321215908.175465-2-aleksey.oladko@virtuozzo.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/reuseport_bpf.c
tools/testing/selftests/net/reuseport_bpf_cpu.c
tools/testing/selftests/net/reuseport_bpf_numa.c
tools/testing/selftests/net/reuseport_dualstack.c