selftests: forwarding: add TCPDUMP_EXTRA_FLAGS to lib.sh
authorJoachim Wiberg <troglobit@gmail.com>
Fri, 22 Apr 2022 10:14:58 +0000 (13:14 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 23 Apr 2022 11:18:16 +0000 (12:18 +0100)
For some use-cases we may want to change the tcpdump flags used in
tcpdump_start().  For instance, observing interfaces without the PROMISC
flag, e.g. to see what's really being forwarded to the bridge interface.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/forwarding/lib.sh [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index e3b3cde..de10451
@@ -28,6 +28,7 @@ LOW_AGEING_TIME=${LOW_AGEING_TIME:=1000}
 REQUIRE_JQ=${REQUIRE_JQ:=yes}
 REQUIRE_MZ=${REQUIRE_MZ:=yes}
 STABLE_MAC_ADDRS=${STABLE_MAC_ADDRS:=no}
+TCPDUMP_EXTRA_FLAGS=${TCPDUMP_EXTRA_FLAGS:=}
 
 relative_path="${BASH_SOURCE%/*}"
 if [[ "$relative_path" == "${BASH_SOURCE}" ]]; then
@@ -1405,7 +1406,7 @@ tcpdump_start()
                capuser="-Z $SUDO_USER"
        fi
 
-       $ns_cmd tcpdump -e -n -Q in -i $if_name \
+       $ns_cmd tcpdump $TCPDUMP_EXTRA_FLAGS -e -n -Q in -i $if_name \
                -s 65535 -B 32768 $capuser -w $capfile > "$capout" 2>&1 &
        cappid=$!