Lines Matching refs:xdst
55 static int xfrm_bundle_ok(struct xfrm_dst *xdst);
1530 struct xfrm_dst *xdst = container_of(flo, struct xfrm_dst, flo); in xfrm_bundle_flo_get() local
1531 struct dst_entry *dst = &xdst->u.dst; in xfrm_bundle_flo_get()
1533 if (xdst->route == NULL) { in xfrm_bundle_flo_get()
1537 if (xdst->num_xfrms > 0) in xfrm_bundle_flo_get()
1553 struct xfrm_dst *xdst = container_of(flo, struct xfrm_dst, flo); in xfrm_bundle_flo_check() local
1554 struct dst_entry *dst = &xdst->u.dst; in xfrm_bundle_flo_check()
1556 if (!xdst->route) in xfrm_bundle_flo_check()
1566 struct xfrm_dst *xdst = container_of(flo, struct xfrm_dst, flo); in xfrm_bundle_flo_delete() local
1567 struct dst_entry *dst = &xdst->u.dst; in xfrm_bundle_flo_delete()
1582 struct xfrm_dst *xdst; in xfrm_alloc_dst() local
1599 xdst = dst_alloc(dst_ops, NULL, 0, DST_OBSOLETE_NONE, 0); in xfrm_alloc_dst()
1601 if (likely(xdst)) { in xfrm_alloc_dst()
1602 struct dst_entry *dst = &xdst->u.dst; in xfrm_alloc_dst()
1604 memset(dst + 1, 0, sizeof(*xdst) - sizeof(*dst)); in xfrm_alloc_dst()
1605 xdst->flo.ops = &xfrm_bundle_fc_ops; in xfrm_alloc_dst()
1607 xdst = ERR_PTR(-ENOBUFS); in xfrm_alloc_dst()
1611 return xdst; in xfrm_alloc_dst()
1631 static inline int xfrm_fill_dst(struct xfrm_dst *xdst, struct net_device *dev, in xfrm_fill_dst() argument
1635 xfrm_policy_get_afinfo(xdst->u.dst.ops->family); in xfrm_fill_dst()
1641 err = afinfo->fill_dst(xdst, dev, fl); in xfrm_fill_dst()
1683 struct xfrm_dst *xdst = xfrm_alloc_dst(net, family); in xfrm_bundle_create() local
1684 struct dst_entry *dst1 = &xdst->u.dst; in xfrm_bundle_create()
1686 err = PTR_ERR(xdst); in xfrm_bundle_create()
1687 if (IS_ERR(xdst)) { in xfrm_bundle_create()
1710 xdst->route = dst; in xfrm_bundle_create()
1724 xdst->xfrm_genid = xfrm[i]->genid; in xfrm_bundle_create()
1754 struct xfrm_dst *xdst = (struct xfrm_dst *)dst_prev; in xfrm_bundle_create() local
1756 err = xfrm_fill_dst(xdst, dev, fl); in xfrm_bundle_create()
1762 header_len -= xdst->u.dst.xfrm->props.header_len; in xfrm_bundle_create()
1763 trailer_len -= xdst->u.dst.xfrm->props.trailer_len; in xfrm_bundle_create()
1797 struct xfrm_dst *xdst = (struct xfrm_dst *)dst; in xfrm_dst_update_parent() local
1798 return xfrm_dst_alloc_copy((void **)&(xdst->partner), in xfrm_dst_update_parent()
1809 struct xfrm_dst *xdst = (struct xfrm_dst *)dst; in xfrm_dst_update_origin() local
1810 return xfrm_dst_alloc_copy((void **)&(xdst->origin), fl, sizeof(*fl)); in xfrm_dst_update_origin()
1868 struct xfrm_dst *xdst; in xfrm_resolve_and_create_bundle() local
1885 xdst = (struct xfrm_dst *)dst; in xfrm_resolve_and_create_bundle()
1886 xdst->num_xfrms = err; in xfrm_resolve_and_create_bundle()
1897 xdst->num_pols = num_pols; in xfrm_resolve_and_create_bundle()
1898 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols); in xfrm_resolve_and_create_bundle()
1899 xdst->policy_genid = atomic_read(&pols[0]->genid); in xfrm_resolve_and_create_bundle()
1901 return xdst; in xfrm_resolve_and_create_bundle()
1984 struct xfrm_dst *xdst = (struct xfrm_dst *) dst; in xdst_queue_output() local
1985 struct xfrm_policy *pol = xdst->pols[0]; in xdst_queue_output()
2032 struct xfrm_dst *xdst; in xfrm_create_dummy_bundle() local
2034 xdst = xfrm_alloc_dst(net, family); in xfrm_create_dummy_bundle()
2035 if (IS_ERR(xdst)) in xfrm_create_dummy_bundle()
2036 return xdst; in xfrm_create_dummy_bundle()
2041 return xdst; in xfrm_create_dummy_bundle()
2044 dst1 = &xdst->u.dst; in xfrm_create_dummy_bundle()
2046 xdst->route = dst; in xfrm_create_dummy_bundle()
2068 err = xfrm_fill_dst(xdst, dev, fl); in xfrm_create_dummy_bundle()
2073 return xdst; in xfrm_create_dummy_bundle()
2077 xdst = ERR_PTR(err); in xfrm_create_dummy_bundle()
2087 struct xfrm_dst *xdst, *new_xdst; in xfrm_bundle_lookup() local
2091 xdst = NULL; in xfrm_bundle_lookup()
2093 xdst = container_of(oldflo, struct xfrm_dst, flo); in xfrm_bundle_lookup()
2094 num_pols = xdst->num_pols; in xfrm_bundle_lookup()
2095 num_xfrms = xdst->num_xfrms; in xfrm_bundle_lookup()
2098 pols[i] = xdst->pols[i]; in xfrm_bundle_lookup()
2102 dst_free(&xdst->u.dst); in xfrm_bundle_lookup()
2103 xdst = NULL; in xfrm_bundle_lookup()
2112 if (xdst == NULL) { in xfrm_bundle_lookup()
2134 dst_hold(&xdst->u.dst); in xfrm_bundle_lookup()
2140 xdst->num_xfrms = 0; in xfrm_bundle_lookup()
2141 dst_hold(&xdst->u.dst); in xfrm_bundle_lookup()
2146 if (xdst) { in xfrm_bundle_lookup()
2148 xdst->num_pols = 0; in xfrm_bundle_lookup()
2149 dst_free(&xdst->u.dst); in xfrm_bundle_lookup()
2161 xdst = xfrm_create_dummy_bundle(net, xflo, fl, num_xfrms, family); in xfrm_bundle_lookup()
2162 if (IS_ERR(xdst)) { in xfrm_bundle_lookup()
2164 return ERR_CAST(xdst); in xfrm_bundle_lookup()
2166 xdst->num_pols = num_pols; in xfrm_bundle_lookup()
2167 xdst->num_xfrms = num_xfrms; in xfrm_bundle_lookup()
2168 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols); in xfrm_bundle_lookup()
2170 dst_hold(&xdst->u.dst); in xfrm_bundle_lookup()
2171 return &xdst->flo; in xfrm_bundle_lookup()
2176 if (xdst != NULL) in xfrm_bundle_lookup()
2177 dst_free(&xdst->u.dst); in xfrm_bundle_lookup()
2211 struct xfrm_dst *xdst; in xfrm_lookup() local
2218 xdst = NULL; in xfrm_lookup()
2236 xdst = xfrm_resolve_and_create_bundle( in xfrm_lookup()
2239 if (IS_ERR(xdst)) { in xfrm_lookup()
2241 err = PTR_ERR(xdst); in xfrm_lookup()
2243 } else if (xdst == NULL) { in xfrm_lookup()
2249 dst_hold(&xdst->u.dst); in xfrm_lookup()
2250 xdst->u.dst.flags |= DST_NOCACHE; in xfrm_lookup()
2251 route = xdst->route; in xfrm_lookup()
2255 if (xdst == NULL) { in xfrm_lookup()
2274 xdst = container_of(flo, struct xfrm_dst, flo); in xfrm_lookup()
2276 num_pols = xdst->num_pols; in xfrm_lookup()
2277 num_xfrms = xdst->num_xfrms; in xfrm_lookup()
2278 memcpy(pols, xdst->pols, sizeof(struct xfrm_policy *) * num_pols); in xfrm_lookup()
2279 route = xdst->route; in xfrm_lookup()
2282 dst = &xdst->u.dst; in xfrm_lookup()
2721 struct xfrm_dst *xdst = (struct xfrm_dst *)dst; in xfrm_init_pmtu() local
2725 xdst->child_mtu_cached = pmtu; in xfrm_init_pmtu()
2729 route_mtu_cached = dst_mtu(xdst->route); in xfrm_init_pmtu()
2730 xdst->route_mtu_cached = route_mtu_cached; in xfrm_init_pmtu()
2759 struct xfrm_dst *xdst = (struct xfrm_dst *)dst; in xfrm_bundle_ok() local
2763 if (xdst->xfrm_genid != dst->xfrm->genid) in xfrm_bundle_ok()
2765 if (xdst->num_pols > 0 && in xfrm_bundle_ok()
2766 xdst->policy_genid != atomic_read(&xdst->pols[0]->genid)) in xfrm_bundle_ok()
2770 if (xdst->child_mtu_cached != mtu) { in xfrm_bundle_ok()
2771 last = xdst; in xfrm_bundle_ok()
2772 xdst->child_mtu_cached = mtu; in xfrm_bundle_ok()
2775 if (!dst_check(xdst->route, xdst->route_cookie)) in xfrm_bundle_ok()
2777 mtu = dst_mtu(xdst->route); in xfrm_bundle_ok()
2778 if (xdst->route_mtu_cached != mtu) { in xfrm_bundle_ok()
2779 last = xdst; in xfrm_bundle_ok()
2780 xdst->route_mtu_cached = mtu; in xfrm_bundle_ok()