summaryrefslogtreecommitdiff
path: root/samples/pktgen/pktgen_sample04_many_flows.sh
diff options
context:
space:
mode:
authorJ.J. Martzki <mars14850@gmail.com>2023-07-01 22:37:37 +0800
committerDavid S. Miller <davem@davemloft.net>2023-07-03 09:15:26 +0100
commita27ac5390922059867f645eefd978e533d7af902 (patch)
treecc707a1806e2f0e82b1bc8cd9d088dd9e0838ae2 /samples/pktgen/pktgen_sample04_many_flows.sh
parentf56d1eeaeabf3aa613157b26aa07215fcd2c5719 (diff)
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_sample04_many_flows.sh')
-rwxr-xr-xsamples/pktgen/pktgen_sample04_many_flows.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/samples/pktgen/pktgen_sample04_many_flows.sh b/samples/pktgen/pktgen_sample04_many_flows.sh
index cff51f861506..65ed486ce4f1 100755
--- a/samples/pktgen/pktgen_sample04_many_flows.sh
+++ b/samples/pktgen/pktgen_sample04_many_flows.sh
@@ -12,6 +12,10 @@ root_check_run_with_sudo "$@"
# Parameter parsing via include
source ${basedir}/parameters.sh
+
+# Trap EXIT first
+trap_exit
+
# Set some default params, if they didn't get set
if [ -z "$DEST_IP" ]; then
[ -z "$IP6" ] && DEST_IP="198.18.0.42" || DEST_IP="FD00::1"