[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEA6p_AeFQb6H3+43_NgSEYTyo+9QePYG4OkjNih+LuAWs2GFg@mail.gmail.com>
Date: Wed, 19 Jun 2019 16:25:16 -0700
From: Wei Wang <weiwan@...gle.com>
To: David Ahern <dsahern@...il.com>
Cc: Wei Wang <tracywwnj@...il.com>, David Miller <davem@...emloft.net>,
Linux Kernel Network Developers <netdev@...r.kernel.org>,
Eric Dumazet <edumazet@...gle.com>,
Mahesh Bandewar <maheshb@...gle.com>,
Martin KaFai Lau <kafai@...com>
Subject: Re: [PATCH v2 net-next 3/5] ipv6: honor RT6_LOOKUP_F_DST_NOREF in
rule lookup logic
On Wed, Jun 19, 2019 at 4:12 PM David Ahern <dsahern@...il.com> wrote:
>
> On 6/19/19 4:31 PM, Wei Wang wrote:
> > diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
> > index bcfae13409b5..d22b6c140f23 100644
> > --- a/net/ipv6/fib6_rules.c
> > +++ b/net/ipv6/fib6_rules.c
> > @@ -113,14 +113,15 @@ struct dst_entry *fib6_rule_lookup(struct net *net, struct flowi6 *fl6,
> > rt = lookup(net, net->ipv6.fib6_local_tbl, fl6, skb, flags);
> > if (rt != net->ipv6.ip6_null_entry && rt->dst.error != -EAGAIN)
> > return &rt->dst;
> > - ip6_rt_put(rt);
> > + ip6_rt_put_flags(rt, flags);
> > rt = lookup(net, net->ipv6.fib6_main_tbl, fl6, skb, flags);
> > if (rt->dst.error != -EAGAIN)
> > return &rt->dst;
> > - ip6_rt_put(rt);
> > + ip6_rt_put_flags(rt, flags);
> > }
> >
> > - dst_hold(&net->ipv6.ip6_null_entry->dst);
> > + if (!(flags & RT6_LOOKUP_F_DST_NOREF))
> > + dst_hold(&net->ipv6.ip6_null_entry->dst);
> > return &net->ipv6.ip6_null_entry->dst;
> > }
> >
>
> What about the fib6_rule_lookup when CONFIG_IPV6_MULTIPLE_TABLES is
> configured off? If caller passes in RT6_LOOKUP_F_DST_NOREF that version
> is still taking a reference in the error path and does a put after the
> lookup.
True. I missed that part. Thanks for catching it. Will update.
Powered by blists - more mailing lists