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:
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"
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user