Skip to content

Commit de23920

Browse files
matttbekuba-moo
authored andcommitted
selftests: mptcp: clearly declare global ns vars
It is clearer to declare these global variables at the beginning of the file as it is done in other MPTCP selftests rather than in functions in the middle of the script. So for uniformity reason, we can do the same here in mptcp_sockopt.sh. Suggested-by: Geliang Tang <[email protected]> Reviewed-by: Mat Martineau <[email protected]> Signed-off-by: Matthieu Baerts <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 787eb1e commit de23920

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tools/testing/selftests/net/mptcp/mptcp_sockopt.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ timeout_poll=30
1111
timeout_test=$((timeout_poll * 2 + 1))
1212
mptcp_connect=""
1313

14+
sec=$(date +%s)
15+
rndh=$(printf %x $sec)-$(mktemp -u XXXXXX)
16+
ns1="ns1-$rndh"
17+
ns2="ns2-$rndh"
18+
ns_sbox="ns_sbox-$rndh"
19+
1420
add_mark_rules()
1521
{
1622
local ns=$1
@@ -30,14 +36,6 @@ add_mark_rules()
3036

3137
init()
3238
{
33-
local sec rndh
34-
sec=$(date +%s)
35-
rndh=$(printf %x $sec)-$(mktemp -u XXXXXX)
36-
37-
ns1="ns1-$rndh"
38-
ns2="ns2-$rndh"
39-
ns_sbox="ns_sbox-$rndh"
40-
4139
for netns in "$ns1" "$ns2" "$ns_sbox";do
4240
ip netns add $netns || exit $ksft_skip
4341
ip -net $netns link set lo up

0 commit comments

Comments
 (0)