Re: [PATCH v2] net/ipv6: allow device-only routes via the multipath API

From: azey

Date: Fri Nov 28 2025 - 10:45:51 EST


On 2025-11-28 16:28:57 +0100 Nicolas Dichtel <nicolas.dichtel@xxxxxxxxx> wrote:
> Le 28/11/2025 à 13:38, azey a écrit :
> > On 2025-11-28 09:38:07 +0100 Nicolas Dichtel <nicolas.dichtel@xxxxxxxxx> wrote:
> >> With IPv6, unlike IPv4, the ECMP next hops can be added one by one. Your commit
> >> doesn't allow this:
> >>
> >> $ ip -6 route add 2002::/64 via fd00:125::2 dev ntfp2
> >> $ ip -6 route append 2002::/64 dev ntfp3
> >> $ ip -6 route
> >> 2002::/64 via fd00:125::2 dev ntfp2 metric 1024 pref medium
> >> 2002::/64 dev ntfp3 metric 1024 pref medium
> >> ...
> >> $ ip -6 route append 2002::/64 via fd00:175::2 dev ntfp3
> >> $ ip -6 route
> >> 2002::/64 metric 1024 pref medium
> >> nexthop via fd00:125::2 dev ntfp2 weight 1
> >> nexthop via fd00:175::2 dev ntfp3 weight 1
> >>
> >> Note that the previous route via ntfp3 has been removed.
> >
> > I just tested your example in a VM with my patch, and everything works
> > as you described. This is due to fib6_explicit_ecmp not overriding
> I tested your patch ;-)
>
> 'ip -6 route append 2002::/64 dev ntfp3' failed to add the next hop, a second
> route was created.

Right, sorry! Still though, I tested the same thing without my patch and
observed the exact same behavior:

$ ip -6 r add 2002::/64 via fd00::2 dev wg0
$ ip -6 r append 2002::/64 dev wg1
$ ip -6 r
2002::/64 via fd00::2 dev wg0 metric 1024 pref medium
2002::/64 dev wg1 metric 1024 pref medium
...
$ ip -6 r append 2002::/64 via fd01::2 dev wg1
$ ip -6 r
2002::/64 metric 1024 pref medium
nexthop via fd00::2 dev wg0 weight 1
nexthop via fd01::2 dev wg1 weight 1
...

The 2002::/64 dev wg1 route also gets removed. Could you test this on
your side to confirm? I think this is actually the current behavior.