Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: icmp_redirect: Add support for routing via nexthop objects

Add a second pass to icmp_redirect.sh to use nexthop objects for
routes.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

David Ahern and committed by
David S. Miller
622946d9 438a9a85

+49
+49
tools/testing/selftests/net/icmp_redirect.sh
··· 331 331 run_cmd ip netns exec h1 ${ping6} -q -M want -i 0.5 -c 10 -w 2 -s ${sz} ${H1_PING_ARG} ${H2_N2_IP6} 332 332 } 333 333 334 + replace_route_new() 335 + { 336 + # r1 to h2 via r2 and eth0 337 + run_cmd ip -netns r1 nexthop replace id 1 via ${R2_N1_IP} dev eth0 338 + run_cmd ip -netns r1 nexthop replace id 2 via ${R2_LLADDR} dev eth0 339 + } 340 + 341 + reset_route_new() 342 + { 343 + run_cmd ip -netns r1 nexthop flush 344 + run_cmd ip -netns h1 nexthop flush 345 + 346 + initial_route_new 347 + } 348 + 349 + initial_route_new() 350 + { 351 + # r1 to h2 via r2 and eth1 352 + run_cmd ip -netns r1 nexthop add id 1 via ${R2_R1_N1_IP} dev eth1 353 + run_cmd ip -netns r1 ro add ${H2_N2} nhid 1 354 + 355 + run_cmd ip -netns r1 nexthop add id 2 via ${R2_R1_N1_IP6} dev eth1 356 + run_cmd ip -netns r1 -6 ro add ${H2_N2_6} nhid 2 357 + 358 + # h1 to h2 via r1 359 + run_cmd ip -netns h1 nexthop add id 1 via ${R1_N1_IP} dev br0 360 + run_cmd ip -netns h1 ro add ${H1_VRF_ARG} ${H2_N2} nhid 1 361 + 362 + run_cmd ip -netns h1 nexthop add id 2 via ${R1_LLADDR} dev br0 363 + run_cmd ip -netns h1 -6 ro add ${H1_VRF_ARG} ${H2_N2_6} nhid 2 364 + } 365 + 334 366 replace_route_legacy() 335 367 { 336 368 # r1 to h2 via r2 and eth0 ··· 510 478 WITH_VRF=yes 511 479 setup 512 480 do_test "legacy" 481 + 482 + cleanup 483 + log_section "Routing with nexthop objects" 484 + ip nexthop ls >/dev/null 2>&1 485 + if [ $? -eq 0 ]; then 486 + WITH_VRF=no 487 + setup 488 + do_test "new" 489 + 490 + cleanup 491 + log_section "Routing with nexthop objects and VRF" 492 + WITH_VRF=yes 493 + setup 494 + do_test "new" 495 + else 496 + echo "Nexthop objects not supported; skipping tests" 497 + fi 513 498 514 499 printf "\nTests passed: %3d\n" ${nsuccess} 515 500 printf "Tests failed: %3d\n" ${nfail}