summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorRomain KUNTZ <r.kuntz@ipflavors.com>2013-02-18 02:36:24 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-02-28 05:38:40 -0800
commit0680a2c2b6c92fdbb2ff8a8c87b0207db5323de7 (patch)
tree6e31c5aa0b2578d4ac5f4bdcf69f949df695bc31 /net
parent2373718e7ac2bd28488778b38ef826c36aa4999a (diff)
xfrm: release neighbor upon dst destruction
[ Upstream commit 18cf0d0784b4a634472ed24d0d7ca1c721d93e90 ] Neighbor is cloned in xfrm6_fill_dst but seems to never be released. Neighbor entry should be released when XFRM6 dst entry is destroyed in xfrm6_dst_destroy, otherwise references may be kept forever on the device pointed by the neighbor entry. I may not have understood all the subtleties of XFRM & dst so I would be happy to receive comments on this patch. Signed-off-by: Romain Kuntz <r.kuntz@ipflavors.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/xfrm6_policy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index c9844135c9ca..8f32718677bd 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -236,6 +236,8 @@ static void xfrm6_dst_destroy(struct dst_entry *dst)
{
struct xfrm_dst *xdst = (struct xfrm_dst *)dst;
+ if (likely(xdst->u.rt6.n))
+ neigh_release(xdst->u.rt6.n);
if (likely(xdst->u.rt6.rt6i_idev))
in6_dev_put(xdst->u.rt6.rt6i_idev);
dst_destroy_metrics_generic(dst);