Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7cc2edb8 authored by David S. Miller's avatar David S. Miller
Browse files

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: default avatarDavid S. Miller <davem@davemloft.net>
parent 34c92049
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -98,6 +98,10 @@ static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
	if (!xdst->u.rt6.rt6i_idev)
		return -ENODEV;

	xdst->u.rt6.rt6i_peer = rt->rt6i_peer;
	if (rt->rt6i_peer)
		atomic_inc(&rt->rt6i_peer->refcnt);

	/* Sheit... I remember I did this right. Apparently,
	 * it was magically lost, so this code needs audit */
	xdst->u.rt6.rt6i_flags = rt->rt6i_flags & (RTF_ANYCAST |
@@ -216,6 +220,8 @@ static void xfrm6_dst_destroy(struct dst_entry *dst)

	if (likely(xdst->u.rt6.rt6i_idev))
		in6_dev_put(xdst->u.rt6.rt6i_idev);
	if (likely(xdst->u.rt6.rt6i_peer))
		inet_putpeer(xdst->u.rt6.rt6i_peer);
	xfrm_dst_destroy(xdst);
}