Lines Matching refs:xdst

55 static int xfrm_bundle_ok(struct xfrm_dst *xdst);
1509 struct xfrm_dst *xdst = container_of(flo, struct xfrm_dst, flo); in xfrm_bundle_flo_get() local
1510 struct dst_entry *dst = &xdst->u.dst; in xfrm_bundle_flo_get()
1512 if (xdst->route == NULL) { in xfrm_bundle_flo_get()
1516 if (xdst->num_xfrms > 0) in xfrm_bundle_flo_get()
1532 struct xfrm_dst *xdst = container_of(flo, struct xfrm_dst, flo); in xfrm_bundle_flo_check() local
1533 struct dst_entry *dst = &xdst->u.dst; in xfrm_bundle_flo_check()
1535 if (!xdst->route) in xfrm_bundle_flo_check()
1545 struct xfrm_dst *xdst = container_of(flo, struct xfrm_dst, flo); in xfrm_bundle_flo_delete() local
1546 struct dst_entry *dst = &xdst->u.dst; in xfrm_bundle_flo_delete()
1561 struct xfrm_dst *xdst; in xfrm_alloc_dst() local
1578 xdst = dst_alloc(dst_ops, NULL, 0, DST_OBSOLETE_NONE, 0); in xfrm_alloc_dst()
1580 if (likely(xdst)) { in xfrm_alloc_dst()
1581 struct dst_entry *dst = &xdst->u.dst; in xfrm_alloc_dst()
1583 memset(dst + 1, 0, sizeof(*xdst) - sizeof(*dst)); in xfrm_alloc_dst()
1584 xdst->flo.ops = &xfrm_bundle_fc_ops; in xfrm_alloc_dst()
1586 afinfo->init_dst(net, xdst); in xfrm_alloc_dst()
1588 xdst = ERR_PTR(-ENOBUFS); in xfrm_alloc_dst()
1592 return xdst; in xfrm_alloc_dst()
1612 static inline int xfrm_fill_dst(struct xfrm_dst *xdst, struct net_device *dev, in xfrm_fill_dst() argument
1616 xfrm_policy_get_afinfo(xdst->u.dst.ops->family); in xfrm_fill_dst()
1622 err = afinfo->fill_dst(xdst, dev, fl); in xfrm_fill_dst()
1664 struct xfrm_dst *xdst = xfrm_alloc_dst(net, family); in xfrm_bundle_create() local
1665 struct dst_entry *dst1 = &xdst->u.dst; in xfrm_bundle_create()
1667 err = PTR_ERR(xdst); in xfrm_bundle_create()
1668 if (IS_ERR(xdst)) { in xfrm_bundle_create()
1691 xdst->route = dst; in xfrm_bundle_create()
1705 xdst->xfrm_genid = xfrm[i]->genid; in xfrm_bundle_create()
1735 struct xfrm_dst *xdst = (struct xfrm_dst *)dst_prev; in xfrm_bundle_create() local
1737 err = xfrm_fill_dst(xdst, dev, fl); in xfrm_bundle_create()
1743 header_len -= xdst->u.dst.xfrm->props.header_len; in xfrm_bundle_create()
1744 trailer_len -= xdst->u.dst.xfrm->props.trailer_len; in xfrm_bundle_create()
1778 struct xfrm_dst *xdst = (struct xfrm_dst *)dst; in xfrm_dst_update_parent() local
1779 return xfrm_dst_alloc_copy((void **)&(xdst->partner), in xfrm_dst_update_parent()
1790 struct xfrm_dst *xdst = (struct xfrm_dst *)dst; in xfrm_dst_update_origin() local
1791 return xfrm_dst_alloc_copy((void **)&(xdst->origin), fl, sizeof(*fl)); in xfrm_dst_update_origin()
1849 struct xfrm_dst *xdst; in xfrm_resolve_and_create_bundle() local
1866 xdst = (struct xfrm_dst *)dst; in xfrm_resolve_and_create_bundle()
1867 xdst->num_xfrms = err; in xfrm_resolve_and_create_bundle()
1878 xdst->num_pols = num_pols; in xfrm_resolve_and_create_bundle()
1879 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols); in xfrm_resolve_and_create_bundle()
1880 xdst->policy_genid = atomic_read(&pols[0]->genid); in xfrm_resolve_and_create_bundle()
1882 return xdst; in xfrm_resolve_and_create_bundle()
1966 struct xfrm_dst *xdst = (struct xfrm_dst *) dst; in xdst_queue_output() local
1967 struct xfrm_policy *pol = xdst->pols[0]; in xdst_queue_output()
2014 struct xfrm_dst *xdst; in xfrm_create_dummy_bundle() local
2016 xdst = xfrm_alloc_dst(net, family); in xfrm_create_dummy_bundle()
2017 if (IS_ERR(xdst)) in xfrm_create_dummy_bundle()
2018 return xdst; in xfrm_create_dummy_bundle()
2023 return xdst; in xfrm_create_dummy_bundle()
2026 dst1 = &xdst->u.dst; in xfrm_create_dummy_bundle()
2028 xdst->route = dst; in xfrm_create_dummy_bundle()
2050 err = xfrm_fill_dst(xdst, dev, fl); in xfrm_create_dummy_bundle()
2055 return xdst; in xfrm_create_dummy_bundle()
2059 xdst = ERR_PTR(err); in xfrm_create_dummy_bundle()
2069 struct xfrm_dst *xdst, *new_xdst; in xfrm_bundle_lookup() local
2073 xdst = NULL; in xfrm_bundle_lookup()
2075 xdst = container_of(oldflo, struct xfrm_dst, flo); in xfrm_bundle_lookup()
2076 num_pols = xdst->num_pols; in xfrm_bundle_lookup()
2077 num_xfrms = xdst->num_xfrms; in xfrm_bundle_lookup()
2080 pols[i] = xdst->pols[i]; in xfrm_bundle_lookup()
2084 dst_free(&xdst->u.dst); in xfrm_bundle_lookup()
2085 xdst = NULL; in xfrm_bundle_lookup()
2094 if (xdst == NULL) { in xfrm_bundle_lookup()
2116 dst_hold(&xdst->u.dst); in xfrm_bundle_lookup()
2122 xdst->num_xfrms = 0; in xfrm_bundle_lookup()
2123 dst_hold(&xdst->u.dst); in xfrm_bundle_lookup()
2128 if (xdst) { in xfrm_bundle_lookup()
2130 xdst->num_pols = 0; in xfrm_bundle_lookup()
2131 dst_free(&xdst->u.dst); in xfrm_bundle_lookup()
2143 xdst = xfrm_create_dummy_bundle(net, xflo, fl, num_xfrms, family); in xfrm_bundle_lookup()
2144 if (IS_ERR(xdst)) { in xfrm_bundle_lookup()
2146 return ERR_CAST(xdst); in xfrm_bundle_lookup()
2148 xdst->num_pols = num_pols; in xfrm_bundle_lookup()
2149 xdst->num_xfrms = num_xfrms; in xfrm_bundle_lookup()
2150 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols); in xfrm_bundle_lookup()
2152 dst_hold(&xdst->u.dst); in xfrm_bundle_lookup()
2153 return &xdst->flo; in xfrm_bundle_lookup()
2158 if (xdst != NULL) in xfrm_bundle_lookup()
2159 dst_free(&xdst->u.dst); in xfrm_bundle_lookup()
2193 struct xfrm_dst *xdst; in xfrm_lookup() local
2200 xdst = NULL; in xfrm_lookup()
2217 xdst = xfrm_resolve_and_create_bundle( in xfrm_lookup()
2220 if (IS_ERR(xdst)) { in xfrm_lookup()
2222 err = PTR_ERR(xdst); in xfrm_lookup()
2224 } else if (xdst == NULL) { in xfrm_lookup()
2230 dst_hold(&xdst->u.dst); in xfrm_lookup()
2231 xdst->u.dst.flags |= DST_NOCACHE; in xfrm_lookup()
2232 route = xdst->route; in xfrm_lookup()
2236 if (xdst == NULL) { in xfrm_lookup()
2255 xdst = container_of(flo, struct xfrm_dst, flo); in xfrm_lookup()
2257 num_pols = xdst->num_pols; in xfrm_lookup()
2258 num_xfrms = xdst->num_xfrms; in xfrm_lookup()
2259 memcpy(pols, xdst->pols, sizeof(struct xfrm_policy *) * num_pols); in xfrm_lookup()
2260 route = xdst->route; in xfrm_lookup()
2263 dst = &xdst->u.dst; in xfrm_lookup()
2701 struct xfrm_dst *xdst = (struct xfrm_dst *)dst; in xfrm_init_pmtu() local
2705 xdst->child_mtu_cached = pmtu; in xfrm_init_pmtu()
2709 route_mtu_cached = dst_mtu(xdst->route); in xfrm_init_pmtu()
2710 xdst->route_mtu_cached = route_mtu_cached; in xfrm_init_pmtu()
2739 struct xfrm_dst *xdst = (struct xfrm_dst *)dst; in xfrm_bundle_ok() local
2743 if (xdst->xfrm_genid != dst->xfrm->genid) in xfrm_bundle_ok()
2745 if (xdst->num_pols > 0 && in xfrm_bundle_ok()
2746 xdst->policy_genid != atomic_read(&xdst->pols[0]->genid)) in xfrm_bundle_ok()
2750 if (xdst->child_mtu_cached != mtu) { in xfrm_bundle_ok()
2751 last = xdst; in xfrm_bundle_ok()
2752 xdst->child_mtu_cached = mtu; in xfrm_bundle_ok()
2755 if (!dst_check(xdst->route, xdst->route_cookie)) in xfrm_bundle_ok()
2757 mtu = dst_mtu(xdst->route); in xfrm_bundle_ok()
2758 if (xdst->route_mtu_cached != mtu) { in xfrm_bundle_ok()
2759 last = xdst; in xfrm_bundle_ok()
2760 xdst->route_mtu_cached = mtu; in xfrm_bundle_ok()