From: Matteo Croce <mcroce@linux.microsoft.com>
To: David Ahern <dsahern@gmail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH net 1/2] ipv6: create multicast route with RTPROT_KERNEL
Date: Sat, 16 Jan 2021 13:17:01 +0100 [thread overview]
Message-ID: <CAFnufp06wpTst2dkD-fhUex=8n74o6=GUpexDDNzHQH8wfD4WQ@mail.gmail.com> (raw)
In-Reply-To: <5a553d08-2b3f-79a2-2c0e-b1ad644a43d4@gmail.com>
On Sat, Jan 16, 2021 at 5:36 AM David Ahern <dsahern@gmail.com> wrote:
>
> On 1/15/21 11:42 AM, Matteo Croce wrote:
> > From: Matteo Croce <mcroce@microsoft.com>
> >
> > The ff00::/8 multicast route is created without specifying the fc_protocol
> > field, so the default RTPROT_BOOT value is used:
> >
> > $ ip -6 -d route
> > unicast ::1 dev lo proto kernel scope global metric 256 pref medium
> > unicast fe80::/64 dev eth0 proto kernel scope global metric 256 pref medium
> > unicast ff00::/8 dev eth0 proto boot scope global metric 256 pref medium
> >
> > As the documentation says, this value identifies routes installed during
> > boot, but the route is created when interface is set up.
> > Change the value to RTPROT_KERNEL which is a better value.
> >
> > Signed-off-by: Matteo Croce <mcroce@microsoft.com>
> > ---
> > net/ipv6/addrconf.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> > index eff2cacd5209..19bf6822911c 100644
> > --- a/net/ipv6/addrconf.c
> > +++ b/net/ipv6/addrconf.c
> > @@ -2469,6 +2469,7 @@ static void addrconf_add_mroute(struct net_device *dev)
> > .fc_flags = RTF_UP,
> > .fc_type = RTN_UNICAST,
> > .fc_nlinfo.nl_net = dev_net(dev),
> > + .fc_protocol = RTPROT_KERNEL,
> > };
> >
> > ipv6_addr_set(&cfg.fc_dst, htonl(0xFF000000), 0, 0, 0);
> >
>
>
> What's the motivation for changing this? ie., what s/w cares that it is
> kernel vs boot?
A practical example: systemd-networkd explicitly ignores routes with
kernel flag[1]. Having a different flag leads the daemon to remove the
route sooner or later.
[1] https://github.com/systemd/systemd/blob/0b81225e5791f660506f7db0ab88078cf296b771/src/network/networkd-routing-policy-rule.c#L675-L677
--
per aspera ad upstream
next prev parent reply other threads:[~2021-01-16 12:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-15 18:42 [PATCH net 0/2] ipv6: fixes for the multicast routes Matteo Croce
2021-01-15 18:42 ` [PATCH net 1/2] ipv6: create multicast route with RTPROT_KERNEL Matteo Croce
2021-01-16 4:36 ` David Ahern
2021-01-16 12:17 ` Matteo Croce [this message]
2021-01-15 18:42 ` [PATCH net 2/2] ipv6: set multicast flag on the multicast route Matteo Croce
2021-01-15 22:50 ` [PATCH net 0/2] ipv6: fixes for the multicast routes Jakub Kicinski
2021-01-15 23:12 ` Matteo Croce
2021-01-16 4:41 ` David Ahern
2021-01-17 2:28 ` Matteo Croce
2021-01-19 4:00 ` patchwork-bot+netdevbpf
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='CAFnufp06wpTst2dkD-fhUex=8n74o6=GUpexDDNzHQH8wfD4WQ@mail.gmail.com' \
--to=mcroce@linux.microsoft.com \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.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).