[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b4b81499-d53a-d697-4cb6-20338606d68a@6wind.com>
Date: Fri, 1 Sep 2023 11:50:12 +0200
From: Nicolas Dichtel <nicolas.dichtel@...nd.com>
To: Hangbin Liu <liuhangbin@...il.com>
Cc: David Ahern <dsahern@...nel.org>, netdev@...r.kernel.org,
"David S . Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Ido Schimmel <idosch@...sch.org>,
Thomas Haller <thaller@...hat.com>
Subject: Re: [PATCH net-next] ipv6: do not merge differe type and protocol
routes
Le 01/09/2023 à 05:58, Hangbin Liu a écrit :
> On Thu, Aug 31, 2023 at 01:58:48PM +0200, Nicolas Dichtel wrote:
>>> The append should also works for a single route, not only for append nexthop, no?
>> I don't think so. The 'append' should 'join', not add. Adding more cases where a
>> route is added instead of appended doesn't make the API clearer.
It was clear to me. I distinguish the route part and the next hop part.
>>
>> With this patch, it will be possible to add a new route with the 'append'
>> command when the 'add' command fails:
>> $ ip -6 route add local 2003:1:2:3::/64 via 2001::2 dev eth1 table 200
>> $ ip -6 route add unicast 2003:1:2:3::/64 via 2001::2 dev eth1 table 200
>> RTNETLINK answers: File exists
>>
>> $ ip -6 route add 2003:1:2:3::/64 via 2001::2 dev eth1 protocol bgp table 200
>> $ ip -6 route add 2003:1:2:3::/64 via 2001::2 dev eth1 protocol kernel table 200
>> RTNETLINK answers: File exists
>>
>> This makes the API more confusing and complex. And I don't understand how it
>> will be used later. There will be 2 routes on the system, but only one will be
>> used, which one? This is confusing.
>
> Just to makeit it clear, the new patch will not add two route with only
> different type/protocol. Here is the result with my patch.
>
> + ip -6 route flush table 300
> + ip link add dummy1 up type dummy
> + ip link add dummy2 up type dummy
> + ip addr add 2001:db8:101::1/64 dev dummy1
> + ip addr add 2001:db8:101::2/64 dev dummy2
> + ip route add local 2001:db8:103::/64 via 2001:db8:101::10 dev dummy1 table 100
> + ip route append unicast 2001:db8:103::/64 via 2001:db8:101::10 dev dummy1 table 100
> RTNETLINK answers: File exists
>
> ^^ here the append still failed
And if I play a little bit of the devil's advocate: why is it rejected? It's not
the same route, the types differ :)
>
> + ip route append unicast 2001:db8:103::/64 via 2001:db8:101::10 dev dummy2 table 100
> + ip -6 route show table 100
> local 2001:db8:103::/64 via 2001:db8:101::10 dev dummy1 metric 1024 pref medium
> 2001:db8:103::/64 via 2001:db8:101::10 dev dummy2 metric 1024 pref medium
What is the purpose of such a routing table?
How is the gateway of a local route used by the kernel?
Which route will be used when a packet enters the stack?
Regards,
Nicolas
Powered by blists - more mailing lists