mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-14 02:09:07 +08:00
selftests: lib: tc_rule_stats_get(): Move default to argument definition
The argument $dir has a fallback value of "ingress". Move the fallback from the usage site to the argument definition block to make the fact clearer. Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Danielle Ratson <danieller@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
28e67746b7
commit
9b5d5f2726
@@ -199,10 +199,10 @@ tc_rule_stats_get()
|
||||
{
|
||||
local dev=$1; shift
|
||||
local pref=$1; shift
|
||||
local dir=$1; shift
|
||||
local dir=${1:-ingress}; shift
|
||||
local selector=${1:-.packets}; shift
|
||||
|
||||
tc -j -s filter show dev $dev ${dir:-ingress} pref $pref \
|
||||
tc -j -s filter show dev $dev $dir pref $pref \
|
||||
| jq ".[1].options.actions[].stats$selector"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user