netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: David Ahern <dsahern@gmail.com>, netdev@vger.kernel.org
Cc: Beniamino Galvani <bgalvani@redhat.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH net] ipv4: fix route update on metric change.
Date: Fri, 25 Oct 2019 12:24:22 +0200	[thread overview]
Message-ID: <e73c5f4e91c194a35fcb07a824dec3b0335494b3.camel@redhat.com> (raw)
In-Reply-To: <a93347d4-b363-23c8-75e4-d5d0c8ad4592@gmail.com>

On Thu, 2019-10-24 at 09:50 -0600, David Ahern wrote:
> On 10/24/19 3:19 AM, Paolo Abeni wrote:
> > Since commit af4d768ad28c ("net/ipv4: Add support for specifying metric
> > of connected routes"), when updating an IP address with a different metric,
> > the associated connected route is updated, too.
> > 
> > Still, the mentioned commit doesn't handle properly some corner cases:
> > 
> > $ ip addr add dev eth0 192.168.1.0/24
> > $ ip addr add dev eth0 192.168.2.1/32 peer 192.168.2.2
> > $ ip addr add dev eth0 192.168.3.1/24
> > $ ip addr change dev eth0 192.168.1.0/24 metric 10
> > $ ip addr change dev eth0 192.168.2.1/32 peer 192.168.2.2 metric 10
> > $ ip addr change dev eth0 192.168.3.1/24 metric 10
> > $ ip -4 route
> > 192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.0
> > 192.168.2.2 dev eth0 proto kernel scope link src 192.168.2.1
> > 192.168.3.0/24 dev eth0 proto kernel scope link src 192.168.2.1 metric 10
> 
> Please add this test and route checking to
> tools/testing/selftests/net/fib_tests.sh. There is a
> ipv4_addr_metric_test function that handles permutations and I guess the
> above was missed.

Do you prefer a net-next patch for that, or a repost on -net with a
separate patch for the self-test appended?

> Also, does a similar sequence for IPv6 work as expected?

Just tested, it works without issue, It looks like IPv6 has not special
handing connected route with peers/128 bit masks.

Thank you,

Paolo


  reply	other threads:[~2019-10-25 10:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-24  9:19 [PATCH net] ipv4: fix route update on metric change Paolo Abeni
2019-10-24 15:50 ` David Ahern
2019-10-25 10:24   ` Paolo Abeni [this message]
2019-10-25 14:33     ` David Ahern

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=e73c5f4e91c194a35fcb07a824dec3b0335494b3.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=bgalvani@redhat.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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).