Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Brian Vazquez <brianvv@google.com>
To: Eric Dumazet <edumazet@google.com>
Cc: Brian Vazquez <brianvv.kernel@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	LKML <linux-kernel@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>,
	David Ahern <dsa@cumulusnetworks.com>
Subject: Re: [PATCH] net: ipv6: fix __rt6_purge_dflt_routers when forwarding is not set on all ifaces
Date: Tue, 1 Sep 2020 08:43:45 -0700	[thread overview]
Message-ID: <CAMzD94TF+q5600oVTMbYNSng=ZCwNdz2RCybSgeW4O5g3nCzeg@mail.gmail.com> (raw)
In-Reply-To: <CANn89iL+C5QWxbqKbxcdAa=BtDkEg-tm5dNnvrvXJrMRXQb=mg@mail.gmail.com>

On Tue, Sep 1, 2020 at 1:20 AM Eric Dumazet <edumazet@google.com> wrote:
>
> On Tue, Sep 1, 2020 at 8:58 AM Brian Vazquez <brianvv@google.com> wrote:
> >
> > The problem is exposed when the system has multiple ifaces and
> > forwarding is enabled on a subset of them, __rt6_purge_dflt_routers will
> > clean the default route on all the ifaces which is not desired.
>
> What is the exact problem you want to fix ?
Imagine you have a host with 2 interfaces. 1 is using SLAAC, the other
one it isn't.
On your main routing table you have the default SLAAC route for iface A

Then you're setting a second interface B and you enable forwarding
only on this iface:
echo 1 > /proc/sys/net/ipv6/conf/B/forwarding. Changing the sysctl
which call the rt6_purge_dflt_routers
which would delete your default route on iface A, so effectively you
will lose connection via iface A, until the default
entry is added again which would happen because that iface has
accept_ra = 1 and forwarding = 0, but it would take some time.
It feels weird that modifying interface B deletes default route A
which would be added back anyway, but you lose connection on A for
some minutes.

>
> >
> > This patches fixes that by cleaning only the routes where the iface has
> > forwarding enabled.
>
> This seems like a new feature, and this might break some setups.

Fair enough, the main issue here is that the behaviour of a host in a
mixed environment is not well defined.

>
> linux always had removed any IPv6 address and default route it learnt via SLAAC.
> (this might be to conform to one RFC or known security rule).
> It would be nice to add a nice comment giving references.
>
> >
> > Fixes: 830218c1add1 ("net: ipv6: Fix processing of RAs in presence of VRF")
>
> Please provide a test, or a better commit message ?
>
> If your patch targets the net tree, then it should only fix a bug.
>
> Thanks.

      reply	other threads:[~2020-09-01 15:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01  6:57 Brian Vazquez
2020-09-01  7:56 ` Eric Dumazet
2020-09-01 14:57   ` David Ahern
2020-09-01 15:50     ` Brian Vazquez
2020-09-01 16:39       ` David Ahern
2020-09-01 15:33   ` Brian Vazquez
2020-09-01  8:20 ` Eric Dumazet
2020-09-01 15:43   ` Brian Vazquez [this message]

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='CAMzD94TF+q5600oVTMbYNSng=ZCwNdz2RCybSgeW4O5g3nCzeg@mail.gmail.com' \
    --to=brianvv@google.com \
    --cc=brianvv.kernel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=edumazet@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [PATCH] net: ipv6: fix __rt6_purge_dflt_routers when forwarding is not set on all ifaces' \
    /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

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).