aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/xfrm6_policy.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/xfrm6_policy.c')
-rw-r--r--net/ipv6/xfrm6_policy.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 8625fba96db9..d7494845efbf 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -99,9 +99,7 @@ static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
99 if (!xdst->u.rt6.rt6i_idev) 99 if (!xdst->u.rt6.rt6i_idev)
100 return -ENODEV; 100 return -ENODEV;
101 101
102 xdst->u.rt6.rt6i_peer = rt->rt6i_peer; 102 rt6_transfer_peer(&xdst->u.rt6, rt);
103 if (rt->rt6i_peer)
104 atomic_inc(&rt->rt6i_peer->refcnt);
105 103
106 /* Sheit... I remember I did this right. Apparently, 104 /* Sheit... I remember I did this right. Apparently,
107 * it was magically lost, so this code needs audit */ 105 * it was magically lost, so this code needs audit */
@@ -223,8 +221,10 @@ static void xfrm6_dst_destroy(struct dst_entry *dst)
223 if (likely(xdst->u.rt6.rt6i_idev)) 221 if (likely(xdst->u.rt6.rt6i_idev))
224 in6_dev_put(xdst->u.rt6.rt6i_idev); 222 in6_dev_put(xdst->u.rt6.rt6i_idev);
225 dst_destroy_metrics_generic(dst); 223 dst_destroy_metrics_generic(dst);
226 if (likely(xdst->u.rt6.rt6i_peer)) 224 if (rt6_has_peer(&xdst->u.rt6)) {
227 inet_putpeer(xdst->u.rt6.rt6i_peer); 225 struct inet_peer *peer = rt6_peer_ptr(&xdst->u.rt6);
226 inet_putpeer(peer);
227 }
228 xfrm_dst_destroy(xdst); 228 xfrm_dst_destroy(xdst);
229} 229}
230 230