diff options
author | David S. Miller | 2018-09-25 10:35:29 -0700 |
---|---|---|
committer | David S. Miller | 2018-09-25 10:35:29 -0700 |
commit | a06ee256e5d6f03fffbd088de9bf84035658cc5a (patch) | |
tree | 9b88044cd4a46496d15a05b43246810c8b677f46 /net/ipv6/route.c | |
parent | bd6207202db8974ca3d3183ca0d5611d45b2973c (diff) | |
parent | 846e8dd47c264e0b359afed28ea88e0acdee6818 (diff) |
Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net
Version bump conflict in batman-adv, take what's in net-next.
iavf conflict, adjustment of netdev_ops in net-next conflicting
with poll controller method removal in net.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 938db8ae2316..d28f83e01593 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -364,11 +364,14 @@ EXPORT_SYMBOL(ip6_dst_alloc); static void ip6_dst_destroy(struct dst_entry *dst) { + struct dst_metrics *p = (struct dst_metrics *)DST_METRICS_PTR(dst); struct rt6_info *rt = (struct rt6_info *)dst; struct fib6_info *from; struct inet6_dev *idev; - dst_destroy_metrics_generic(dst); + if (p != &dst_default_metrics && refcount_dec_and_test(&p->refcnt)) + kfree(p); + rt6_uncached_list_del(rt); idev = rt->rt6i_idev; @@ -976,6 +979,10 @@ static void rt6_set_from(struct rt6_info *rt, struct fib6_info *from) rt->rt6i_flags &= ~RTF_EXPIRES; rcu_assign_pointer(rt->from, from); dst_init_metrics(&rt->dst, from->fib6_metrics->metrics, true); + if (from->fib6_metrics != &dst_default_metrics) { + rt->dst._metrics |= DST_METRICS_REFCOUNTED; + refcount_inc(&from->fib6_metrics->refcnt); + } } /* Caller must already hold reference to @ort */ |