diff options
| author | Hangbin Liu <[email protected]> | 2022-01-25 08:17:15 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2022-01-28 03:21:28 +0000 |
| commit | ab6bcc20722775022c5ab0086824e9d2e3ceefcd (patch) | |
| tree | 33fff04206dd9769212d3049c1811d5fe245d91d /tools/testing/selftests/bpf/test_tcp_check_syncookie.sh | |
| parent | selftests/bpf/test_lwt_seg6local: use temp netns for testing (diff) | |
| download | kernel-ab6bcc20722775022c5ab0086824e9d2e3ceefcd.tar.gz kernel-ab6bcc20722775022c5ab0086824e9d2e3ceefcd.zip | |
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 <[email protected]>
Acked-by: Lorenz Bauer <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/test_tcp_check_syncookie.sh')
| -rwxr-xr-x | tools/testing/selftests/bpf/test_tcp_check_syncookie.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/test_tcp_check_syncookie.sh b/tools/testing/selftests/bpf/test_tcp_check_syncookie.sh index 6413c1472554..102e6588e2fe 100755 --- a/tools/testing/selftests/bpf/test_tcp_check_syncookie.sh +++ b/tools/testing/selftests/bpf/test_tcp_check_syncookie.sh @@ -4,6 +4,7 @@ # Copyright (c) 2019 Cloudflare set -eu +readonly NS1="ns1-$(mktemp -u XXXXXX)" wait_for_ip() { @@ -28,12 +29,12 @@ get_prog_id() ns1_exec() { - ip netns exec ns1 "$@" + ip netns exec ${NS1} "$@" } setup() { - ip netns add ns1 + ip netns add ${NS1} ns1_exec ip link set lo up ns1_exec sysctl -w net.ipv4.tcp_syncookies=2 |
