[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0e12d8a0-4ef8-4b22-bc61-072247df47a7@kernel.org>
Date: Mon, 22 Jan 2024 21:59:22 -0700
From: David Ahern <dsahern@...nel.org>
To: gaoxingwang <gaoxingwang1@...wei.com>, edumazet@...gle.com
Cc: davem@...emloft.net, liaichun@...wei.com, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, pabeni@...hat.com, yanan@...wei.com,
yoshfuji@...ux-ipv6.org
Subject: Re: [Discuss]iproute2: ipv6 route add fail
On 1/22/24 8:08 PM, gaoxingwang wrote:
>>> Hello everyone,
>>>
>>> Here is a particular problem with routing.
>>> Sometimes users can run the ip -6 route command to add a route whose destination address is the same as the gateway address, and it can be successfully added. However, adding another route with the same gateway address will fail later.
>>>
>>> Example:
>>> # ip -6 route add 2409:8080:5a0a:60c7::7/128 via 2409:8080:5a0a:60c7::7 dev eth2
I missed that this is a self-referencing route. This one really should
fail because it adds itself as a gateway.
>>> # ip -6 route add 2409:8080:5a0a:60c7::8/128 via 2409:8080:5a0a:60c7::7 dev eth2
>>> RTNETLINK answers: No route to host
and this one fails because of the above self referencing route; see
ip6_route_check_nh:
err = ip6_nh_lookup_table(net, cfg, gw_addr,
cfg->fc_table, flags, &res);
/* gw_addr can not require a gateway or resolve to a reject
* route. If a device is given, it must match the result.
*/
>>>
>>> Does the kernel not support this application scenario?
you need to remove the host route that adds a gateway as itself
Powered by blists - more mailing lists