diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2014-09-03 17:59:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-05 20:13:24 -0400 |
commit | f24062b07dda89b0e24fa48e7bc3865a725f5ee6 (patch) | |
tree | 99d8da425d3074968570d56cd4931910df876f21 /net | |
parent | c199105d154e029cd8c94cccd35bd073e64acc45 (diff) |
ipv6: fix a refcnt leak with peer addr
There is no reason to take a refcnt before deleting the peer address route.
It's done some lines below for the local prefix route because
inet6_ifa_finish_destroy() will release it at the end.
For the peer address route, we want to free it right now.
This bug has been introduced by commit
caeaba79009c ("ipv6: add support of peer address").
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/addrconf.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index aa0e135b808c..ce761c7e6675 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -4772,11 +4772,8 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) | |||
4772 | 4772 | ||
4773 | rt = rt6_lookup(dev_net(dev), &ifp->peer_addr, NULL, | 4773 | rt = rt6_lookup(dev_net(dev), &ifp->peer_addr, NULL, |
4774 | dev->ifindex, 1); | 4774 | dev->ifindex, 1); |
4775 | if (rt) { | 4775 | if (rt && ip6_del_rt(rt)) |
4776 | dst_hold(&rt->dst); | 4776 | dst_free(&rt->dst); |
4777 | if (ip6_del_rt(rt)) | ||
4778 | dst_free(&rt->dst); | ||
4779 | } | ||
4780 | } | 4777 | } |
4781 | dst_hold(&ifp->rt->dst); | 4778 | dst_hold(&ifp->rt->dst); |
4782 | 4779 | ||