Skip to content

Commit 676f4bb

Browse files
idoschdavem330
authored andcommitted
selftests: rtnetlink: Add a test case for multipath route get
Without previous patch a warning would be generated upon multipath route get when FIB multipath hash policy is to use a 5-tuple for multipath hash calculation. Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 21f9477 commit 676f4bb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tools/testing/selftests/net/rtnetlink.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ kci_test_polrouting()
205205

206206
kci_test_route_get()
207207
{
208+
local hash_policy=$(sysctl -n net.ipv4.fib_multipath_hash_policy)
209+
208210
ret=0
209211

210212
ip route get 127.0.0.1 > /dev/null
@@ -223,6 +225,19 @@ kci_test_route_get()
223225
check_err $?
224226
ip route get 10.23.7.11 from 10.23.7.12 iif "$devdummy" > /dev/null
225227
check_err $?
228+
ip route add 10.23.8.0/24 \
229+
nexthop via 10.23.7.13 dev "$devdummy" \
230+
nexthop via 10.23.7.14 dev "$devdummy"
231+
check_err $?
232+
sysctl -wq net.ipv4.fib_multipath_hash_policy=0
233+
ip route get 10.23.8.11 > /dev/null
234+
check_err $?
235+
sysctl -wq net.ipv4.fib_multipath_hash_policy=1
236+
ip route get 10.23.8.11 > /dev/null
237+
check_err $?
238+
sysctl -wq net.ipv4.fib_multipath_hash_policy="$hash_policy"
239+
ip route del 10.23.8.0/24
240+
check_err $?
226241
ip addr del dev "$devdummy" 10.23.7.11/24
227242
check_err $?
228243

0 commit comments

Comments
 (0)