diff options
author | J.J. Martzki <mars14850@gmail.com> | 2023-07-01 16:37:37 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-07-03 10:15:26 +0200 |
commit | a27ac5390922059867f645eefd978e533d7af902 (patch) | |
tree | cc707a1806e2f0e82b1bc8cd9d088dd9e0838ae2 /samples/pktgen/pktgen_bench_xmit_mode_queue_xmit.sh | |
parent | selftests/net: Add xt_policy config for xfrm_policy test (diff) | |
download | linux-a27ac5390922059867f645eefd978e533d7af902.tar.xz linux-a27ac5390922059867f645eefd978e533d7af902.zip |
samples: pktgen: fix append mode failed issue
Each sample script sources functions.sh before parameters.sh
which makes $APPEND undefined when trapping EXIT no matter in
append mode or not. Due to this when sample scripts finished
they always do "pgctrl reset" which resets pktgen config.
So move trap to each script after sourcing parameters.sh
and trap EXIT explicitly.
Signed-off-by: J.J. Martzki <mars14850@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/pktgen/pktgen_bench_xmit_mode_queue_xmit.sh')
-rwxr-xr-x | samples/pktgen/pktgen_bench_xmit_mode_queue_xmit.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/samples/pktgen/pktgen_bench_xmit_mode_queue_xmit.sh b/samples/pktgen/pktgen_bench_xmit_mode_queue_xmit.sh index 04b0dd0c36d6..f2beb512c5cd 100755 --- a/samples/pktgen/pktgen_bench_xmit_mode_queue_xmit.sh +++ b/samples/pktgen/pktgen_bench_xmit_mode_queue_xmit.sh @@ -14,6 +14,10 @@ root_check_run_with_sudo "$@" # Parameter parsing via include source ${basedir}/parameters.sh + +# Trap EXIT first +trap_exit + if [ -z "$DEST_IP" ]; then [ -z "$IP6" ] && DEST_IP="198.18.0.42" || DEST_IP="FD00::1" fi |