[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9fb8564a-ea22-e6a6-b804-95157825cf94@cumulusnetworks.com>
Date: Tue, 19 Mar 2019 22:14:42 +0100
From: David Ahern <dsa@...ulusnetworks.com>
To: Xin Long <lucien.xin@...il.com>
Cc: Paolo Abeni <pabeni@...hat.com>, Wei Wang <weiwan@...gle.com>,
network dev <netdev@...r.kernel.org>,
"David S . Miller" <davem@...emloft.net>
Subject: Re: [PATCH net] ipv6: make ip6_create_rt_rcu return ip6_null_entry
instead of NULL
On 3/19/19 7:21 PM, Xin Long wrote:
> I will post v2 by moving down 'fallback:':
>
> { ...
> if (!fib6_info_hold_safe(rt))
> goto fallback;
>
> nrt = ip6_dst_alloc(dev_net(dev), dev, flags);
> if (!nrt) {
> fib6_info_release(rt);
> goto fallback;
> }
>
> ip6_rt_copy_init(nrt, rt);
> return nrt;
>
> fallback:
> nrt = dev_net(dev)->ipv6.ip6_null_entry;
> dst_hold(&nrt->dst);
> return nrt;
> }
I think that is the more typical pattern. Thanks,
Powered by blists - more mailing lists