Skip to content

Commit 95eb6ef

Browse files
Guillaume Naultkuba-moo
authored andcommitted
selftests: rtnetlink: Use more sensible tos values
Using tos 0x1 with 'ip route get <IPv4 address> ...' doesn't test much of the tos option handling: 0x1 just sets an ECN bit, which is cleared by inet_rtm_getroute() before doing the fib lookup. Let's use 0x10 instead, which is actually taken into account in the route lookup (and is less surprising for the reader). For consistency, use 0x10 for the IPv6 route lookup too (IPv6 currently doesn't clear ECN bits, but might do so in the future). Signed-off-by: Guillaume Nault <[email protected]> Link: https://lore.kernel.org/r/d61119e68d01ba7ef3ba50c1345a5123a11de123.1643815297.git.gnault@redhat.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent bafe517 commit 95eb6ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/testing/selftests/net/rtnetlink.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ kci_test_route_get()
216216
check_err $?
217217
ip route get fe80::1 dev "$devdummy" > /dev/null
218218
check_err $?
219-
ip route get 127.0.0.1 from 127.0.0.1 oif lo tos 0x1 mark 0x1 > /dev/null
219+
ip route get 127.0.0.1 from 127.0.0.1 oif lo tos 0x10 mark 0x1 > /dev/null
220220
check_err $?
221-
ip route get ::1 from ::1 iif lo oif lo tos 0x1 mark 0x1 > /dev/null
221+
ip route get ::1 from ::1 iif lo oif lo tos 0x10 mark 0x1 > /dev/null
222222
check_err $?
223223
ip addr add dev "$devdummy" 10.23.7.11/24
224224
check_err $?

0 commit comments

Comments
 (0)