diff options
author | Wei Wang <weiwan@google.com> | 2017-06-17 10:42:33 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-17 22:54:00 -0400 |
commit | 1cfb71eeb12047bcdbd3e6730ffed66e810a0855 (patch) | |
tree | 30120d1365dcfeb59721315bc45c988c67c647a1 /drivers/net/vrf.c | |
parent | b838d5e1c5b6e57b10ec8af2268824041e3ea911 (diff) | |
download | linux-1cfb71eeb12047bcdbd3e6730ffed66e810a0855.tar.gz linux-1cfb71eeb12047bcdbd3e6730ffed66e810a0855.tar.bz2 linux-1cfb71eeb12047bcdbd3e6730ffed66e810a0855.zip |
ipv6: take dst->__refcnt for insertion into fib6 tree
In IPv6 routing code, struct rt6_info is created for each static route
and RTF_CACHE route and inserted into fib6 tree. In both cases, dst
ref count is not taken.
As explained in the previous patch, this leads to the need of the dst
garbage collector.
This patch holds ref count of dst before inserting the route into fib6
tree and properly releases the dst when deleting it from the fib6 tree
as a preparation in order to fully get rid of dst gc later.
Also, correct fib6_age() logic to check dst->__refcnt to be 1 to indicate
no user is referencing the dst.
And remove dst_hold() in vrf_rt6_create() as ip6_dst_alloc() already puts
dst->__refcnt to 1.
Signed-off-by: Wei Wang <weiwan@google.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vrf.c')
-rw-r--r-- | drivers/net/vrf.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c index c6c0595d267b..d038927acfca 100644 --- a/drivers/net/vrf.c +++ b/drivers/net/vrf.c @@ -583,8 +583,6 @@ static int vrf_rt6_create(struct net_device *dev) if (!rt6) goto out; - dst_hold(&rt6->dst); - rt6->rt6i_table = rt6i_table; rt6->dst.output = vrf_output6; @@ -597,8 +595,6 @@ static int vrf_rt6_create(struct net_device *dev) goto out; } - dst_hold(&rt6_local->dst); - rt6_local->rt6i_idev = in6_dev_get(dev); rt6_local->rt6i_flags = RTF_UP | RTF_NONEXTHOP | RTF_LOCAL; rt6_local->rt6i_table = rt6i_table; |