[PATCH RFC v2 net 4/5] ipv6: Avoid double dst_free

2015-09-04 Thread Martin KaFai Lau
It is a prep work to get dst freeing from fib tree undergo a rcu grace period. The following is a common paradigm: if (ip6_del_rt(rt)) dst_free(rt) which means, if rt cannot be deleted from the fib tree, dst_free(rt) now. 1. We don't know the ip6_del_rt(rt) failure is because it was no

Re: [PATCH RFC v2 net 4/5] ipv6: Avoid double dst_free

2015-09-04 Thread Martin KaFai Lau
On Fri, Sep 04, 2015 at 04:12:41PM -0700, Martin KaFai Lau wrote: > @@ -1962,6 +1961,9 @@ static int __ip6_del_rt(struct rt6_info *rt, struct > nl_info *info) > if (rt == net->ipv6.ip6_null_entry) { > err = -ENOENT; > goto out; > + } else if (rt->dst.flags & D