From: Peter Oskolkov <posk@google.com>
To: dsahern@gmail.com
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH net] net/ipv6: do not copy DST_NOCOUNT flag on rt init
Date: Mon, 17 Sep 2018 09:11:35 -0700 [thread overview]
Message-ID: <CAPNVh5f3_GPpvV6nequZ8JNBhMVVOpEsJQ_XRfTN-+eaMPOWpw@mail.gmail.com> (raw)
In-Reply-To: <351e6fbc-5356-b5c1-0638-0554843ad833@gmail.com>
On Thu, Sep 13, 2018 at 9:11 PM David Ahern <dsahern@gmail.com> wrote:
>
> On 9/13/18 1:38 PM, Peter Oskolkov wrote:
>
> > diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> > index 3eed045c65a5..a3902f805305 100644
> > --- a/net/ipv6/route.c
> > +++ b/net/ipv6/route.c
> > @@ -946,7 +946,7 @@ static void ip6_rt_init_dst_reject(struct rt6_info *rt, struct fib6_info *ort)
> >
> > static void ip6_rt_init_dst(struct rt6_info *rt, struct fib6_info *ort)
> > {
> > - rt->dst.flags |= fib6_info_dst_flags(ort);
> > + rt->dst.flags |= fib6_info_dst_flags(ort) & ~DST_NOCOUNT;
>
> I think my mistake is setting dst.flags in ip6_rt_init_dst. Flags
> argument is passed to ip6_dst_alloc which is always invoked before
> ip6_rt_copy_init is called which is the only caller of ip6_rt_init_dst.
ip6_rt_cache_alloc calls ip6_dst_alloc with zero as flags; and only
one flag is copied later (DST_HOST) outside of ip6_rt_init_dst().
If the flag assignment is completely removed from ip6_rt_init_dst(),
then DST_NOPOLICY flag will be lost.
Which may be OK, but is more than what this patch tries to solve (do not
copy DST_NOCOUNT flag).
>
> >
> > if (ort->fib6_flags & RTF_REJECT) {
> > ip6_rt_init_dst_reject(rt, ort);
> >
>
next prev parent reply other threads:[~2018-09-17 21:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-13 20:38 [PATCH net] net/ipv6: do not copy DST_NOCOUNT flag on rt init Peter Oskolkov
2018-09-14 4:11 ` David Ahern
2018-09-17 16:11 ` Peter Oskolkov [this message]
2018-09-17 16:13 ` David Ahern
2018-09-17 16:59 ` David Ahern
2018-09-17 17:23 ` Peter Oskolkov
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=CAPNVh5f3_GPpvV6nequZ8JNBhMVVOpEsJQ_XRfTN-+eaMPOWpw@mail.gmail.com \
--to=posk@google.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).