if (rt->rt6i_node) ((struct xfrm_dst *)dst)->path_cookie = rt->rt6i_node->fn_sernum; 
__xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int nx,		      struct flowi *fl, struct dst_entry **dst_p){	struct dst_entry *dst, *dst_prev;	struct rt6_info *rt0 = (struct rt6_info*)(*dst_p);	struct rt6_info *rt  = rt0;	struct in6_addr *remote = &fl->fl6_dst;	struct in6_addr *local  = &fl->fl6_src;	struct flowi fl_tunnel = {		.nl_u = {			.ip6_u = {				.saddr = *local,				.daddr = *remote			}		}	};	int i;	int err = 0;	int header_len = 0;	int trailer_len = 0;	dst = dst_prev = NULL;	dst_hold(&rt->u.dst);	for (i = 0; i < nx; i++) {		struct dst_entry *dst1 = dst_alloc(&xfrm6_dst_ops);		struct xfrm_dst *xdst;		int tunnel = 0;		if (unlikely(dst1 == NULL)) {			err = -ENOBUFS;			dst_release(&rt->u.dst);			goto error;		}		if (!dst)			dst = dst1;		else {			dst_prev->child = dst1;			dst1->flags |= DST_NOHASH;			dst_clone(dst1);		}		xdst = (struct xfrm_dst *)dst1;		xdst->route = &rt->u.dst;		dst1->next = dst_prev;		dst_prev = dst1;		if (xfrm[i]->props.mode) {			remote = (struct in6_addr*)&xfrm[i]->id.daddr;			local  = (struct in6_addr*)&xfrm[i]->props.saddr;			tunnel = 1;		}		header_len += xfrm[i]->props.header_len;		trailer_len += xfrm[i]->props.trailer_len;		if (tunnel) {			ipv6_addr_copy(&fl_tunnel.fl6_dst, remote);			ipv6_addr_copy(&fl_tunnel.fl6_src, local);			err = xfrm_dst_lookup((struct xfrm_dst **) &rt,					      &fl_tunnel, AF_INET6);			if (err)				goto error;		} else			dst_hold(&rt->u.dst);	}	dst_prev->child = &rt->u.dst;	dst->path = &rt->u.dst;	*dst_p = dst;	dst = dst_prev;	dst_prev = *dst_p;	i = 0;	for (; dst_prev != &rt->u.dst; dst_prev = dst_prev->child) {		struct xfrm_dst *x = (struct xfrm_dst*)dst_prev;		dst_prev->xfrm = xfrm[i++];		dst_prev->dev = rt->u.dst.dev;		if (rt->u.dst.dev)			dev_hold(rt->u.dst.dev);		dst_prev->obsolete	= -1;		dst_prev->flags	       |= DST_HOST;		dst_prev->lastuse	= jiffies;		dst_prev->header_len	= header_len;		dst_prev->trailer_len	= trailer_len;		memcpy(&dst_prev->metrics, &x->route->metrics, sizeof(dst_prev->metrics));		/* Copy neighbour for reachability confirmation */		dst_prev->neighbour	= neigh_clone(rt->u.dst.neighbour);		dst_prev->input		= rt->u.dst.input;		dst_prev->output	= xfrm6_output;		/* Sheit... I remember I did this right. Apparently,		 * it was magically lost, so this code needs audit */		x->u.rt6.rt6i_flags    = rt0->rt6i_flags&(RTCF_BROADCAST|RTCF_MULTICAST|RTCF_LOCAL);		x->u.rt6.rt6i_metric   = rt0->rt6i_metric;		x->u.rt6.rt6i_node     = rt0->rt6i_node;		x->u.rt6.rt6i_gateway  = rt0->rt6i_gateway;		memcpy(&x->u.rt6.rt6i_gateway, &rt0->rt6i_gateway, sizeof(x->u.rt6.rt6i_gateway)); 		x->u.rt6.rt6i_dst      = rt0->rt6i_dst;		x->u.rt6.rt6i_src      = rt0->rt6i_src;			x->u.rt6.rt6i_idev     = rt0->rt6i_idev;		in6_dev_hold(rt0->rt6i_idev);		header_len -= x->u.dst.xfrm->props.header_len;		trailer_len -= x->u.dst.xfrm->props.trailer_len;	}	xfrm_init_pmtu(dst);	return 0;error:	if (dst)		dst_free(dst);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/92d63decc0b6a5d600f792fcf5f3ff9718c09a3d/xfrm6_policy.c/buggy/net/ipv6/xfrm6_policy.c