Commit cec74489 authored by Hangbin Liu's avatar Hangbin Liu Committed by Alexei Starovoitov
Browse files

selftests/bpf/test_xdp_redirect_multi: use temp netns for testing

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

Remove the hard code interface index when creating the veth interfaces.
Because when the system loads some virtual interface modules, e.g. tunnels.
the ifindex of 2 will be used and the cmd will fail.

As the netns has not created if checking environment failed. Trap the
clean up function after checking env.

Fixes: 8955c1a3

 ("selftests/bpf/xdp_redirect_multi: Limit the tests in netns")
Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Acked-by: default avatarWilliam Tu <u9012063@gmail.com>
Link: https://lore.kernel.org/r/20220125081717.1260849-2-liuhangbin@gmail.com


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent b6ec7951
Supports Markdown
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