Lines Matching refs:xdst

171 static int xfrm_bundle_ok(struct xfrm_dst *xdst);
2478 struct xfrm_dst *xdst; in xfrm_alloc_dst() local
2495 xdst = dst_alloc(dst_ops, NULL, 1, DST_OBSOLETE_NONE, 0); in xfrm_alloc_dst()
2497 if (likely(xdst)) { in xfrm_alloc_dst()
2498 struct dst_entry *dst = &xdst->u.dst; in xfrm_alloc_dst()
2500 memset(dst + 1, 0, sizeof(*xdst) - sizeof(*dst)); in xfrm_alloc_dst()
2502 xdst = ERR_PTR(-ENOBUFS); in xfrm_alloc_dst()
2506 return xdst; in xfrm_alloc_dst()
2519 static inline int xfrm_fill_dst(struct xfrm_dst *xdst, struct net_device *dev, in xfrm_fill_dst() argument
2523 xfrm_policy_get_afinfo(xdst->u.dst.ops->family); in xfrm_fill_dst()
2529 err = afinfo->fill_dst(xdst, dev, fl); in xfrm_fill_dst()
2571 struct xfrm_dst *xdst = xfrm_alloc_dst(net, family); in xfrm_bundle_create() local
2572 struct dst_entry *dst1 = &xdst->u.dst; in xfrm_bundle_create()
2574 err = PTR_ERR(xdst); in xfrm_bundle_create()
2575 if (IS_ERR(xdst)) { in xfrm_bundle_create()
2580 bundle[i] = xdst; in xfrm_bundle_create()
2582 xdst0 = xdst; in xfrm_bundle_create()
2587 xfrm_dst_set_child(xdst_prev, &xdst->u.dst); in xfrm_bundle_create()
2600 xdst->route = dst; in xfrm_bundle_create()
2619 xdst->xfrm_genid = xfrm[i]->genid; in xfrm_bundle_create()
2634 xdst_prev = xdst; in xfrm_bundle_create()
2733 struct xfrm_dst *xdst; in xfrm_resolve_and_create_bundle() local
2754 xdst = (struct xfrm_dst *)dst; in xfrm_resolve_and_create_bundle()
2755 xdst->num_xfrms = err; in xfrm_resolve_and_create_bundle()
2756 xdst->num_pols = num_pols; in xfrm_resolve_and_create_bundle()
2757 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols); in xfrm_resolve_and_create_bundle()
2758 xdst->policy_genid = atomic_read(&pols[0]->genid); in xfrm_resolve_and_create_bundle()
2760 return xdst; in xfrm_resolve_and_create_bundle()
2854 struct xfrm_dst *xdst = (struct xfrm_dst *) dst; in xdst_queue_output() local
2855 struct xfrm_policy *pol = xdst->pols[0]; in xdst_queue_output()
2902 struct xfrm_dst *xdst; in xfrm_create_dummy_bundle() local
2904 xdst = xfrm_alloc_dst(net, family); in xfrm_create_dummy_bundle()
2905 if (IS_ERR(xdst)) in xfrm_create_dummy_bundle()
2906 return xdst; in xfrm_create_dummy_bundle()
2911 return xdst; in xfrm_create_dummy_bundle()
2914 dst1 = &xdst->u.dst; in xfrm_create_dummy_bundle()
2916 xdst->route = dst; in xfrm_create_dummy_bundle()
2928 xfrm_dst_set_child(xdst, dst); in xfrm_create_dummy_bundle()
2929 xdst->path = dst; in xfrm_create_dummy_bundle()
2938 err = xfrm_fill_dst(xdst, dev, fl); in xfrm_create_dummy_bundle()
2943 return xdst; in xfrm_create_dummy_bundle()
2947 xdst = ERR_PTR(err); in xfrm_create_dummy_bundle()
2958 struct xfrm_dst *xdst; in xfrm_bundle_lookup() local
2973 xdst = xfrm_resolve_and_create_bundle(pols, num_pols, fl, family, in xfrm_bundle_lookup()
2975 if (IS_ERR(xdst)) { in xfrm_bundle_lookup()
2976 err = PTR_ERR(xdst); in xfrm_bundle_lookup()
2985 } else if (xdst == NULL) { in xfrm_bundle_lookup()
2990 return xdst; in xfrm_bundle_lookup()
2996 xdst = xfrm_create_dummy_bundle(net, xflo, fl, num_xfrms, family); in xfrm_bundle_lookup()
2997 if (IS_ERR(xdst)) { in xfrm_bundle_lookup()
2999 return ERR_CAST(xdst); in xfrm_bundle_lookup()
3001 xdst->num_pols = num_pols; in xfrm_bundle_lookup()
3002 xdst->num_xfrms = num_xfrms; in xfrm_bundle_lookup()
3003 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols); in xfrm_bundle_lookup()
3005 return xdst; in xfrm_bundle_lookup()
3046 struct xfrm_dst *xdst; in xfrm_lookup_with_ifid() local
3053 xdst = NULL; in xfrm_lookup_with_ifid()
3072 xdst = xfrm_resolve_and_create_bundle( in xfrm_lookup_with_ifid()
3076 if (IS_ERR(xdst)) { in xfrm_lookup_with_ifid()
3078 err = PTR_ERR(xdst); in xfrm_lookup_with_ifid()
3083 } else if (xdst == NULL) { in xfrm_lookup_with_ifid()
3089 route = xdst->route; in xfrm_lookup_with_ifid()
3093 if (xdst == NULL) { in xfrm_lookup_with_ifid()
3104 xdst = xfrm_bundle_lookup(net, fl, family, dir, &xflo, if_id); in xfrm_lookup_with_ifid()
3105 if (xdst == NULL) in xfrm_lookup_with_ifid()
3107 if (IS_ERR(xdst)) { in xfrm_lookup_with_ifid()
3108 err = PTR_ERR(xdst); in xfrm_lookup_with_ifid()
3112 num_pols = xdst->num_pols; in xfrm_lookup_with_ifid()
3113 num_xfrms = xdst->num_xfrms; in xfrm_lookup_with_ifid()
3114 memcpy(pols, xdst->pols, sizeof(struct xfrm_policy *) * num_pols); in xfrm_lookup_with_ifid()
3115 route = xdst->route; in xfrm_lookup_with_ifid()
3118 dst = &xdst->u.dst; in xfrm_lookup_with_ifid()
3807 struct xfrm_dst *xdst = bundle[nr]; in xfrm_init_pmtu() local
3811 dst = &xdst->u.dst; in xfrm_init_pmtu()
3813 xdst->child_mtu_cached = pmtu; in xfrm_init_pmtu()
3817 route_mtu_cached = dst_mtu(xdst->route); in xfrm_init_pmtu()
3818 xdst->route_mtu_cached = route_mtu_cached; in xfrm_init_pmtu()
3835 struct xfrm_dst *xdst; in xfrm_bundle_ok() local
3848 struct xfrm_dst *xdst = (struct xfrm_dst *)dst; in xfrm_bundle_ok() local
3852 if (xdst->xfrm_genid != dst->xfrm->genid) in xfrm_bundle_ok()
3854 if (xdst->num_pols > 0 && in xfrm_bundle_ok()
3855 xdst->policy_genid != atomic_read(&xdst->pols[0]->genid)) in xfrm_bundle_ok()
3858 bundle[nr++] = xdst; in xfrm_bundle_ok()
3861 if (xdst->child_mtu_cached != mtu) { in xfrm_bundle_ok()
3863 xdst->child_mtu_cached = mtu; in xfrm_bundle_ok()
3866 if (!dst_check(xdst->route, xdst->route_cookie)) in xfrm_bundle_ok()
3868 mtu = dst_mtu(xdst->route); in xfrm_bundle_ok()
3869 if (xdst->route_mtu_cached != mtu) { in xfrm_bundle_ok()
3871 xdst->route_mtu_cached = mtu; in xfrm_bundle_ok()
3880 xdst = bundle[start_from - 1]; in xfrm_bundle_ok()
3881 mtu = xdst->child_mtu_cached; in xfrm_bundle_ok()
3883 dst = &xdst->u.dst; in xfrm_bundle_ok()
3886 if (mtu > xdst->route_mtu_cached) in xfrm_bundle_ok()
3887 mtu = xdst->route_mtu_cached; in xfrm_bundle_ok()
3892 xdst = bundle[start_from - 1]; in xfrm_bundle_ok()
3893 xdst->child_mtu_cached = mtu; in xfrm_bundle_ok()