]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests: net: add ipv6 RA route to ECMP merge test
authorFernando Fernandez Mancera <fmancera@suse.de>
Fri, 13 Mar 2026 12:48:27 +0000 (13:48 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 17 Mar 2026 11:53:30 +0000 (12:53 +0100)
As commit bbf4a17ad9ff ("ipv6: Fix ECMP sibling count mismatch when
clearing RTF_ADDRCONF") pointed out, RA routes are not elegible for ECMP
merging.

Add a test scenario mixing RA and static routes with gateway to check
that they are not getting merged.

Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
Link: https://patch.msgid.link/20260313124827.3945-1-fmancera@suse.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/testing/selftests/net/config
tools/testing/selftests/net/fib_tests.sh

index cd49b7dfe2160e87549795d1a409438936c203dc..2a390cae41bf2e61998c7f6fc5c62247ebea0db1 100644 (file)
@@ -43,6 +43,8 @@ CONFIG_IPV6_ILA=m
 CONFIG_IPV6_IOAM6_LWTUNNEL=y
 CONFIG_IPV6_MROUTE=y
 CONFIG_IPV6_MULTIPLE_TABLES=y
+CONFIG_IPV6_ROUTE_INFO=y
+CONFIG_IPV6_ROUTER_PREF=y
 CONFIG_IPV6_RPL_LWTUNNEL=y
 CONFIG_IPV6_SEG6_LWTUNNEL=y
 CONFIG_IPV6_SIT=y
index 439461080c60975cbee16ae18b40759a3487b05c..05dadc3f55b154cfffcbe0ae51800830616a31df 100755 (executable)
@@ -1534,6 +1534,23 @@ fib6_ra_to_static()
 
        log_test $ret 0 "ipv6 promote RA route to static"
 
+       # Prepare for RA route with gateway
+       $NS_EXEC sysctl -wq net.ipv6.conf.veth1.accept_ra_rt_info_max_plen=64
+
+       # Add initial route to cause ECMP merging
+       $IP -6 route add 2001:12::/64 via fe80::dead:beef dev veth1
+
+       $NS_EXEC ra6 -i veth2 -d 2001:10::1 -R 2001:12::/64#1#120
+
+       # Routes are not merged as RA routes are not elegible for ECMP
+       check_rt_num 2 "$($IP -6 route list | grep -c "2001:12::/64 via")"
+
+       $IP -6 route append 2001:12::/64 via fe80::dead:feeb dev veth1
+
+       check_rt_num 2 "$($IP -6 route list | grep -c "nexthop via")"
+
+       log_test "$ret" 0 "ipv6 RA route with nexthop do not merge into ECMP with static"
+
        set +e
 
        cleanup &> /dev/null