diff options
author | J.J. Martzki <mars14850@gmail.com> | 2023-07-01 17:37:37 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-07-03 11:15:26 +0300 |
commit | a27ac5390922059867f645eefd978e533d7af902 (patch) | |
tree | cc707a1806e2f0e82b1bc8cd9d088dd9e0838ae2 /samples/pktgen/pktgen_sample01_simple.sh | |
parent | f56d1eeaeabf3aa613157b26aa07215fcd2c5719 (diff) | |
download | linux-a27ac5390922059867f645eefd978e533d7af902.tar.xz |
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_sample01_simple.sh')
-rwxr-xr-x | samples/pktgen/pktgen_sample01_simple.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/samples/pktgen/pktgen_sample01_simple.sh b/samples/pktgen/pktgen_sample01_simple.sh index 09a92ea963f9..cdb9f497f87d 100755 --- a/samples/pktgen/pktgen_sample01_simple.sh +++ b/samples/pktgen/pktgen_sample01_simple.sh @@ -13,6 +13,10 @@ root_check_run_with_sudo "$@" # - go look in parameters.sh to see which setting are avail # - required param is the interface "-i" stored in $DEV source ${basedir}/parameters.sh + +# Trap EXIT first +trap_exit + # # Set some default params, if they didn't get set if [ -z "$DEST_IP" ]; then |