diff options
author | David S. Miller <davem@davemloft.net> | 2011-01-26 16:41:03 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-26 16:41:03 -0500 |
commit | 7cc2edb83447775a34ed3bf9d29d8295a434b523 (patch) | |
tree | cdcbae599c95d6902fcb29989c75810b08f04707 /net/ipv6/xfrm6_policy.c | |
parent | 34c92049ac15dcb731dc455d165b4c3c1df569cf (diff) |
xfrm6: Don't forget to propagate peer into ipsec route.
Like ipv4, we have to propagate the ipv6 route peer into
the ipsec top-level route during instantiation.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/xfrm6_policy.c')
-rw-r--r-- | net/ipv6/xfrm6_policy.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 7e74023ea6e4..da87428681cc 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c | |||
@@ -98,6 +98,10 @@ static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev, | |||
98 | if (!xdst->u.rt6.rt6i_idev) | 98 | if (!xdst->u.rt6.rt6i_idev) |
99 | return -ENODEV; | 99 | return -ENODEV; |
100 | 100 | ||
101 | xdst->u.rt6.rt6i_peer = rt->rt6i_peer; | ||
102 | if (rt->rt6i_peer) | ||
103 | atomic_inc(&rt->rt6i_peer->refcnt); | ||
104 | |||
101 | /* Sheit... I remember I did this right. Apparently, | 105 | /* Sheit... I remember I did this right. Apparently, |
102 | * it was magically lost, so this code needs audit */ | 106 | * it was magically lost, so this code needs audit */ |
103 | xdst->u.rt6.rt6i_flags = rt->rt6i_flags & (RTF_ANYCAST | | 107 | xdst->u.rt6.rt6i_flags = rt->rt6i_flags & (RTF_ANYCAST | |
@@ -216,6 +220,8 @@ static void xfrm6_dst_destroy(struct dst_entry *dst) | |||
216 | 220 | ||
217 | if (likely(xdst->u.rt6.rt6i_idev)) | 221 | if (likely(xdst->u.rt6.rt6i_idev)) |
218 | in6_dev_put(xdst->u.rt6.rt6i_idev); | 222 | in6_dev_put(xdst->u.rt6.rt6i_idev); |
223 | if (likely(xdst->u.rt6.rt6i_peer)) | ||
224 | inet_putpeer(xdst->u.rt6.rt6i_peer); | ||
219 | xfrm_dst_destroy(xdst); | 225 | xfrm_dst_destroy(xdst); |
220 | } | 226 | } |
221 | 227 | ||