Commit ab6bcc20 authored by Hangbin Liu's avatar Hangbin Liu Committed by Alexei Starovoitov

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: default avatarHangbin Liu <liuhangbin@gmail.com>
Acked-by: default avatarLorenz Bauer <lmb@cloudflare.com>
Link: https://lore.kernel.org/r/20220125081717.1260849-6-liuhangbin@gmail.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 07c58554
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# Copyright (c) 2019 Cloudflare # Copyright (c) 2019 Cloudflare
set -eu set -eu
readonly NS1="ns1-$(mktemp -u XXXXXX)"
wait_for_ip() wait_for_ip()
{ {
...@@ -28,12 +29,12 @@ get_prog_id() ...@@ -28,12 +29,12 @@ get_prog_id()
ns1_exec() ns1_exec()
{ {
ip netns exec ns1 "$@" ip netns exec ${NS1} "$@"
} }
setup() setup()
{ {
ip netns add ns1 ip netns add ${NS1}
ns1_exec ip link set lo up ns1_exec ip link set lo up
ns1_exec sysctl -w net.ipv4.tcp_syncookies=2 ns1_exec sysctl -w net.ipv4.tcp_syncookies=2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment