[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <857851ee-c610-0b19-b5b1-1948bebe84ab@gmail.com>
Date: Wed, 19 Jun 2019 17:12:30 -0600
From: David Ahern <dsahern@...il.com>
To: Wei Wang <tracywwnj@...il.com>, David Miller <davem@...emloft.net>,
netdev@...r.kernel.org
Cc: Eric Dumazet <edumazet@...gle.com>,
Mahesh Bandewar <maheshb@...gle.com>,
Martin KaFai Lau <kafai@...com>, Wei Wang <weiwan@...gle.com>
Subject: Re: [PATCH v2 net-next 3/5] ipv6: honor RT6_LOOKUP_F_DST_NOREF in
rule lookup logic
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.
Powered by blists - more mailing lists