From: Hangbin Liu <liuhangbin@gmail.com>
To: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Cc: David Ahern <dsahern@kernel.org>,
netdev@vger.kernel.org, "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Ido Schimmel <idosch@idosch.org>,
Thomas Haller <thaller@redhat.com>
Subject: Re: [PATCH net-next] ipv6: do not merge differe type and protocol routes
Date: Fri, 1 Sep 2023 11:58:54 +0800 [thread overview]
Message-ID: <ZPFhfgScZiekiOQd@Laptop-X1> (raw)
In-Reply-To: <62bcd732-31ed-e358-e8dd-1df237d735ef@6wind.com>
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.
>
> 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
+ 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
+ ip route add 2001:db8:104::/64 via 2001:db8:101::10 dev dummy1 proto kernel table 200
+ ip route append 2001:db8:104::/64 via 2001:db8:101::10 dev dummy1 proto bgp table 200
RTNETLINK answers: File exists
^^ And here
+ ip route append 2001:db8:104::/64 via 2001:db8:101::10 dev dummy2 proto bgp table 200
+ ip -6 route show table 200
2001:db8:104::/64 via 2001:db8:101::10 dev dummy1 proto kernel metric 1024 pref medium
2001:db8:104::/64 via 2001:db8:101::10 dev dummy2 proto bgp metric 1024 pref medium
Thanks
Hangbin
next prev parent reply other threads:[~2023-09-01 3:59 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-30 6:15 [PATCH net-next] ipv6: do not merge differe type and protocol routes Hangbin Liu
2023-08-30 14:49 ` David Ahern
2023-08-30 23:51 ` Hangbin Liu
2023-08-30 15:29 ` Nicolas Dichtel
2023-08-30 18:57 ` David Ahern
2023-08-31 8:17 ` Nicolas Dichtel
2023-08-31 10:14 ` Hangbin Liu
2023-08-31 11:58 ` Nicolas Dichtel
2023-08-31 18:27 ` David Ahern
2023-09-01 9:36 ` Nicolas Dichtel
2023-09-15 2:23 ` Hangbin Liu
2023-09-15 3:08 ` David Ahern
2023-09-15 10:02 ` Hangbin Liu
2023-09-01 3:58 ` Hangbin Liu [this message]
2023-09-01 9:50 ` Nicolas Dichtel
2023-09-15 3:49 ` Hangbin Liu
2023-09-15 15:58 ` Nicolas Dichtel
-- strict thread matches above, loose matches on Subject: below --
2023-08-30 6:16 Hangbin Liu
2023-08-30 9:37 ` Hangbin Liu
2023-08-30 9:48 ` Hangbin Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZPFhfgScZiekiOQd@Laptop-X1 \
--to=liuhangbin@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=idosch@idosch.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=pabeni@redhat.com \
--cc=thaller@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).