Message ID | 20220411133837.318876-6-troglobit@gmail.com (mailing list archive) |
---|---|
State | RFC |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: bridge: forwarding of unknown IPv4/IPv6/MAC BUM traffic | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Clearly marked for net-next |
netdev/apply | fail | Patch does not apply to net-next |
On Mon, Apr 11, 2022 at 03:38:29PM +0200, Joachim Wiberg wrote: > 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> > --- > tools/testing/selftests/net/forwarding/lib.sh | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > mode change 100644 => 100755 tools/testing/selftests/net/forwarding/lib.sh > > diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh > old mode 100644 > new mode 100755 > index 664b9ecaf228..00cdcab7accf > --- a/tools/testing/selftests/net/forwarding/lib.sh > +++ b/tools/testing/selftests/net/forwarding/lib.sh > @@ -1369,7 +1369,13 @@ tcpdump_start() > capuser="-Z $SUDO_USER" > fi > > - $ns_cmd tcpdump -e -n -Q in -i $if_name \ > + if [ -z $TCPDUMP_EXTRA_FLAGS ]; then > + extra_flags="" > + else > + extra_flags="$TCPDUMP_EXTRA_FLAGS" > + fi > + > + $ns_cmd tcpdump $extra_flags -e -n -Q in -i $if_name \ Could you call directly "$ns_cmd tcpdump $TCPDUMP_EXTRA_FLAGS ..." here, without an intermediary "extra_flags" global variable which holds the same content? You could initialize it just like the way other variables are initialized, at the beginning of lib.sh: TCPDUMP_EXTRA_FLAGS=${TCPDUMP_EXTRA_FLAGS:=} > -s 65535 -B 32768 $capuser -w $capfile > "$capout" 2>&1 & > cappid=$! > > -- > 2.25.1 >
On Mon, Apr 11, 2022 at 17:20, Vladimir Oltean <vladimir.oltean@nxp.com> wrote: > On Mon, Apr 11, 2022 at 03:38:29PM +0200, Joachim Wiberg wrote: >> - $ns_cmd tcpdump -e -n -Q in -i $if_name \ >> + if [ -z $TCPDUMP_EXTRA_FLAGS ]; then >> + extra_flags="" >> + else >> + extra_flags="$TCPDUMP_EXTRA_FLAGS" >> + fi >> + >> + $ns_cmd tcpdump $extra_flags -e -n -Q in -i $if_name \ > > Could you call directly "$ns_cmd tcpdump $TCPDUMP_EXTRA_FLAGS ..." here, > without an intermediary "extra_flags" global variable which holds the > same content? > > You could initialize it just like the way other variables are > initialized, at the beginning of lib.sh: > > TCPDUMP_EXTRA_FLAGS=${TCPDUMP_EXTRA_FLAGS:=} Ah, yes of course. Will fix in the next drop! /J
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh old mode 100644 new mode 100755 index 664b9ecaf228..00cdcab7accf --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -1369,7 +1369,13 @@ tcpdump_start() capuser="-Z $SUDO_USER" fi - $ns_cmd tcpdump -e -n -Q in -i $if_name \ + if [ -z $TCPDUMP_EXTRA_FLAGS ]; then + extra_flags="" + else + extra_flags="$TCPDUMP_EXTRA_FLAGS" + fi + + $ns_cmd tcpdump $extra_flags -e -n -Q in -i $if_name \ -s 65535 -B 32768 $capuser -w $capfile > "$capout" 2>&1 & cappid=$!
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> --- tools/testing/selftests/net/forwarding/lib.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) mode change 100644 => 100755 tools/testing/selftests/net/forwarding/lib.sh