File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
tools/testing/selftests/net/mptcp Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22# SPDX-License-Identifier: GPL-2.0
33
4+ . " $( dirname " ${0} " ) /../lib.sh"
5+
46readonly KSFT_PASS=0
57readonly KSFT_FAIL=1
68readonly KSFT_SKIP=4
@@ -438,27 +440,24 @@ mptcp_lib_check_tools() {
438440}
439441
440442mptcp_lib_ns_init () {
441- local sec rndh
442-
443- sec= $( date +%s )
444- rndh= $( printf %x " ${sec} " ) - $( mktemp -u XXXXXX )
443+ if ! setup_ns ${ @ } ; then
444+ mptcp_lib_pr_fail " Failed to setup namespace ${ @ } "
445+ exit ${KSFT_FAIL}
446+ fi
445447
446448 local netns
447449 for netns in " ${@ } " ; do
448- eval " ${netns} =${netns} -${rndh} "
449-
450- ip netns add " ${! netns} " || exit ${KSFT_SKIP}
451- ip -net " ${! netns} " link set lo up
452450 ip netns exec " ${! netns} " sysctl -q net.mptcp.enabled=1
453451 ip netns exec " ${! netns} " sysctl -q net.ipv4.conf.all.rp_filter=0
454452 ip netns exec " ${! netns} " sysctl -q net.ipv4.conf.default.rp_filter=0
455453 done
456454}
457455
458456mptcp_lib_ns_exit () {
457+ cleanup_ns " ${@ } "
458+
459459 local netns
460460 for netns in " ${@ } " ; do
461- ip netns del " ${netns} "
462461 rm -f /tmp/" ${netns} " .{nstat,out}
463462 done
464463}
You can’t perform that action at this time.
0 commit comments