From: David Ahern <dsahern@gmail.com>
To: Stefano Brivio <sbrivio@redhat.com>,
"David S . Miller" <davem@davemloft.net>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
Thomas Graf <tgraf@suug.ch>, Jianlin Shi <jishi@redhat.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH net v2] fib_semantics: Don't match route with mismatching tclassid
Date: Thu, 15 Feb 2018 13:42:53 -0700 [thread overview]
Message-ID: <a472f267-fa57-df60-fdbf-5d5d7aa0665c@gmail.com> (raw)
In-Reply-To: <20180215084603.64905-1-sbrivio@redhat.com>
On 2/15/18 1:46 AM, Stefano Brivio wrote:
> In fib_nh_match(), if output interface or gateway are passed in
> the FIB configuration, we don't have to check next hops of
> multipath routes to conclude whether we have a match or not.
>
> However, we might still have routes with different realms
> matching the same output interface and gateway configuration,
> and this needs to cause the match to fail. Otherwise the first
> route inserted in the FIB will match, regardless of the realms:
>
> # ip route add 1.1.1.1 dev eth0 table 1234 realms 1/2
> # ip route append 1.1.1.1 dev eth0 table 1234 realms 3/4
> # ip route list table 1234
> 1.1.1.1 dev eth0 scope link realms 1/2
> 1.1.1.1 dev eth0 scope link realms 3/4
> # ip route del 1.1.1.1 dev ens3 table 1234 realms 3/4
> # ip route list table 1234
> 1.1.1.1 dev ens3 scope link realms 3/4
>
> whereas route with realms 3/4 should have been deleted instead.
>
> Explicitly check for fc_flow passed in the FIB configuration
> (this comes from RTA_FLOW extracted by rtm_to_fib_config()) and
> fail matching if it differs from nh_tclassid.
>
> The handling of RTA_FLOW for multipath routes later in
> fib_nh_match() is still needed, as we can have multiple RTA_FLOW
> attributes that need to be matched against the tclassid of each
> next hop.
>
> v2: Check that fc_flow is set before discarding the match, so
> that the user can still select the first matching rule by
> not specifying any realm, as suggested by David Ahern.
>
> Reported-by: Jianlin Shi <jishi@redhat.com>
> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
> ---
> net/ipv4/fib_semantics.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
Acked-by: David Ahern <dsahern@gmail.com>
next prev parent reply other threads:[~2018-02-15 20:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-15 8:46 [PATCH net v2] fib_semantics: Don't match route with mismatching tclassid Stefano Brivio
2018-02-15 20:42 ` David Ahern [this message]
2018-02-16 20:21 ` David Miller
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=a472f267-fa57-df60-fdbf-5d5d7aa0665c@gmail.com \
--to=dsahern@gmail.com \
--cc=davem@davemloft.net \
--cc=jishi@redhat.com \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@vger.kernel.org \
--cc=sbrivio@redhat.com \
--cc=tgraf@suug.ch \
/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).