Skip to content

Commit 2e25211

Browse files
Guillaume Naultdavem330
authored andcommitted
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: Guillaume Nault <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8af2ba9 commit 2e25211

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/testing/selftests/net/fib_rule_tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fib_rule6_del()
9696

9797
fib_rule6_del_by_pref()
9898
{
99-
pref=$($IP -6 rule show | grep "$1 lookup $TABLE" | cut -d ":" -f 1)
99+
pref=$($IP -6 rule show $1 table $RTABLE | cut -d ":" -f 1)
100100
$IP -6 rule del pref $pref
101101
}
102102

@@ -168,7 +168,7 @@ fib_rule4_del()
168168

169169
fib_rule4_del_by_pref()
170170
{
171-
pref=$($IP rule show | grep "$1 lookup $TABLE" | cut -d ":" -f 1)
171+
pref=$($IP rule show $1 table $RTABLE | cut -d ":" -f 1)
172172
$IP rule del pref $pref
173173
}
174174

0 commit comments

Comments
 (0)