Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf/test_tcp_check_syncookie: use temp netns for testing

Use temp netns instead of hard code name for testing in case the
netns already exists.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Acked-by: Lorenz Bauer <lmb@cloudflare.com>
Link: https://lore.kernel.org/r/20220125081717.1260849-6-liuhangbin@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Hangbin Liu and committed by
Alexei Starovoitov
ab6bcc20 07c58554

+3 -2
+3 -2
tools/testing/selftests/bpf/test_tcp_check_syncookie.sh
··· 4 4 # Copyright (c) 2019 Cloudflare 5 5 6 6 set -eu 7 + readonly NS1="ns1-$(mktemp -u XXXXXX)" 7 8 8 9 wait_for_ip() 9 10 { ··· 29 28 30 29 ns1_exec() 31 30 { 32 - ip netns exec ns1 "$@" 31 + ip netns exec ${NS1} "$@" 33 32 } 34 33 35 34 setup() 36 35 { 37 - ip netns add ns1 36 + ip netns add ${NS1} 38 37 ns1_exec ip link set lo up 39 38 40 39 ns1_exec sysctl -w net.ipv4.tcp_syncookies=2