Commit 2e252113 authored by Guillaume Nault's avatar Guillaume Nault Committed by David S. Miller

selftests: fib rule: Drop erroneous TABLE variable

The fib_rule6_del_by_pref() and fib_rule4_del_by_pref() functions use
an uninitialised $TABLE variable. They should use $RTABLE instead.
This doesn't alter the result of the test, as it just makes the grep
command less specific (but since the script always uses the same table
number, that doesn't really matter).

Let's fix it anyway and, while there, specify the filtering parameters
directly in 'ip -X rule show' to avoid the extra grep command entirely.
Signed-off-by: default avatarGuillaume Nault <gnault@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8af2ba9a
......@@ -96,7 +96,7 @@ fib_rule6_del()
fib_rule6_del_by_pref()
{
pref=$($IP -6 rule show | grep "$1 lookup $TABLE" | cut -d ":" -f 1)
pref=$($IP -6 rule show $1 table $RTABLE | cut -d ":" -f 1)
$IP -6 rule del pref $pref
}
......@@ -168,7 +168,7 @@ fib_rule4_del()
fib_rule4_del_by_pref()
{
pref=$($IP rule show | grep "$1 lookup $TABLE" | cut -d ":" -f 1)
pref=$($IP rule show $1 table $RTABLE | cut -d ":" -f 1)
$IP rule del pref $pref
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment