On Wed, Sep 30, 2026 at 11:22:28AM -0400, [email protected] wrote:
> From: Hengyu Liang <[email protected]>
> 
> ip6_route_info_create_nh() promotes routes that use the loopback device
> as their nexthop device to reject routes, except for local and anycast
> routes and routes to the loopback address, as true routes via the
> loopback device would result in kernel looping.
> 
> Before commit 21ec92774d15 ("net: ipv6: fix panic when IPv4 route
> references loopback IPv6 nexthop"), fib6_nh_init() also treated these
> routes as reject routes, so it neither validated their gateway nor
> checked the state of the loopback device. That commit restricted the
> check in fib6_nh_init() to explicit reject routes to fix IPv6 nexthop
> objects that use the loopback device. As a side effect, the nexthop of a
> route via the loopback device is now validated like the nexthop of a
> regular route before the route is promoted to a reject route, and adding
> such a route fails in cases that used to work:
> 
>   # ip link set dev lo down
>   # ip -6 route add 2001:db8::/32 dev lo
>   Error: Nexthop device is not up.

Consistent with IPv4 and expected:

# ip link set dev lo down
# ip route add 192.0.2.0/24 dev lo
Error: Device for nexthop is not up.

>   # ip link set dev lo up
>   # ip -6 route add 2001:db8::/32 via 2001:db8:1::1 dev lo
>   RTNETLINK answers: No route to host
>   # ip -6 route add default via ::ffff:192.0.2.1 dev lo
>   RTNETLINK answers: No route to host

Likewise:

# ip link set dev lo up
# ip route add 192.0.2.0/24 via 198.51.100.1 dev lo
Error: Nexthop has invalid gateway.

>   # sysctl -qw net.ipv6.conf.lo.disable_ipv6=1
>   # ip -6 route add 2001:db8::/32 dev lo
>   Error: IPv6 is disabled on nexthop device.

Inapplicable, but expected.

I don't understand what motivated this series.

Reply via email to