Lines Matching refs:xdst

166 static int xfrm_bundle_ok(struct xfrm_dst *xdst);
2545 struct xfrm_dst *xdst; in xfrm_alloc_dst() local
2562 xdst = dst_alloc(dst_ops, NULL, 1, DST_OBSOLETE_NONE, 0); in xfrm_alloc_dst()
2564 if (likely(xdst)) { in xfrm_alloc_dst()
2565 memset_after(xdst, 0, u.dst); in xfrm_alloc_dst()
2567 xdst = ERR_PTR(-ENOBUFS); in xfrm_alloc_dst()
2571 return xdst; in xfrm_alloc_dst()
2584 static inline int xfrm_fill_dst(struct xfrm_dst *xdst, struct net_device *dev, in xfrm_fill_dst() argument
2588 xfrm_policy_get_afinfo(xdst->u.dst.ops->family); in xfrm_fill_dst()
2594 err = afinfo->fill_dst(xdst, dev, fl); in xfrm_fill_dst()
2636 struct xfrm_dst *xdst = xfrm_alloc_dst(net, family); in xfrm_bundle_create() local
2637 struct dst_entry *dst1 = &xdst->u.dst; in xfrm_bundle_create()
2639 err = PTR_ERR(xdst); in xfrm_bundle_create()
2640 if (IS_ERR(xdst)) { in xfrm_bundle_create()
2645 bundle[i] = xdst; in xfrm_bundle_create()
2647 xdst0 = xdst; in xfrm_bundle_create()
2652 xfrm_dst_set_child(xdst_prev, &xdst->u.dst); in xfrm_bundle_create()
2665 xdst->route = dst; in xfrm_bundle_create()
2686 xdst->xfrm_genid = xfrm[i]->genid; in xfrm_bundle_create()
2701 xdst_prev = xdst; in xfrm_bundle_create()
2800 struct xfrm_dst *xdst; in xfrm_resolve_and_create_bundle() local
2821 xdst = (struct xfrm_dst *)dst; in xfrm_resolve_and_create_bundle()
2822 xdst->num_xfrms = err; in xfrm_resolve_and_create_bundle()
2823 xdst->num_pols = num_pols; in xfrm_resolve_and_create_bundle()
2824 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols); in xfrm_resolve_and_create_bundle()
2825 xdst->policy_genid = atomic_read(&pols[0]->genid); in xfrm_resolve_and_create_bundle()
2827 return xdst; in xfrm_resolve_and_create_bundle()
2921 struct xfrm_dst *xdst = (struct xfrm_dst *) dst; in xdst_queue_output() local
2922 struct xfrm_policy *pol = xdst->pols[0]; in xdst_queue_output()
2969 struct xfrm_dst *xdst; in xfrm_create_dummy_bundle() local
2971 xdst = xfrm_alloc_dst(net, family); in xfrm_create_dummy_bundle()
2972 if (IS_ERR(xdst)) in xfrm_create_dummy_bundle()
2973 return xdst; in xfrm_create_dummy_bundle()
2978 return xdst; in xfrm_create_dummy_bundle()
2981 dst1 = &xdst->u.dst; in xfrm_create_dummy_bundle()
2983 xdst->route = dst; in xfrm_create_dummy_bundle()
2995 xfrm_dst_set_child(xdst, dst); in xfrm_create_dummy_bundle()
2996 xdst->path = dst; in xfrm_create_dummy_bundle()
3005 err = xfrm_fill_dst(xdst, dev, fl); in xfrm_create_dummy_bundle()
3010 return xdst; in xfrm_create_dummy_bundle()
3014 xdst = ERR_PTR(err); in xfrm_create_dummy_bundle()
3025 struct xfrm_dst *xdst; in xfrm_bundle_lookup() local
3040 xdst = xfrm_resolve_and_create_bundle(pols, num_pols, fl, family, in xfrm_bundle_lookup()
3042 if (IS_ERR(xdst)) { in xfrm_bundle_lookup()
3043 err = PTR_ERR(xdst); in xfrm_bundle_lookup()
3052 } else if (xdst == NULL) { in xfrm_bundle_lookup()
3057 return xdst; in xfrm_bundle_lookup()
3063 xdst = xfrm_create_dummy_bundle(net, xflo, fl, num_xfrms, family); in xfrm_bundle_lookup()
3064 if (IS_ERR(xdst)) { in xfrm_bundle_lookup()
3066 return ERR_CAST(xdst); in xfrm_bundle_lookup()
3068 xdst->num_pols = num_pols; in xfrm_bundle_lookup()
3069 xdst->num_xfrms = num_xfrms; in xfrm_bundle_lookup()
3070 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols); in xfrm_bundle_lookup()
3072 return xdst; in xfrm_bundle_lookup()
3113 struct xfrm_dst *xdst; in xfrm_lookup_with_ifid() local
3120 xdst = NULL; in xfrm_lookup_with_ifid()
3139 xdst = xfrm_resolve_and_create_bundle( in xfrm_lookup_with_ifid()
3143 if (IS_ERR(xdst)) { in xfrm_lookup_with_ifid()
3145 err = PTR_ERR(xdst); in xfrm_lookup_with_ifid()
3150 } else if (xdst == NULL) { in xfrm_lookup_with_ifid()
3156 route = xdst->route; in xfrm_lookup_with_ifid()
3160 if (xdst == NULL) { in xfrm_lookup_with_ifid()
3171 xdst = xfrm_bundle_lookup(net, fl, family, dir, &xflo, if_id); in xfrm_lookup_with_ifid()
3172 if (xdst == NULL) in xfrm_lookup_with_ifid()
3174 if (IS_ERR(xdst)) { in xfrm_lookup_with_ifid()
3175 err = PTR_ERR(xdst); in xfrm_lookup_with_ifid()
3179 num_pols = xdst->num_pols; in xfrm_lookup_with_ifid()
3180 num_xfrms = xdst->num_xfrms; in xfrm_lookup_with_ifid()
3181 memcpy(pols, xdst->pols, sizeof(struct xfrm_policy *) * num_pols); in xfrm_lookup_with_ifid()
3182 route = xdst->route; in xfrm_lookup_with_ifid()
3185 dst = &xdst->u.dst; in xfrm_lookup_with_ifid()
3857 struct xfrm_dst *xdst = bundle[nr]; in xfrm_init_pmtu() local
3861 dst = &xdst->u.dst; in xfrm_init_pmtu()
3863 xdst->child_mtu_cached = pmtu; in xfrm_init_pmtu()
3867 route_mtu_cached = dst_mtu(xdst->route); in xfrm_init_pmtu()
3868 xdst->route_mtu_cached = route_mtu_cached; in xfrm_init_pmtu()
3885 struct xfrm_dst *xdst; in xfrm_bundle_ok() local
3898 struct xfrm_dst *xdst = (struct xfrm_dst *)dst; in xfrm_bundle_ok() local
3902 if (xdst->xfrm_genid != dst->xfrm->genid) in xfrm_bundle_ok()
3904 if (xdst->num_pols > 0 && in xfrm_bundle_ok()
3905 xdst->policy_genid != atomic_read(&xdst->pols[0]->genid)) in xfrm_bundle_ok()
3908 bundle[nr++] = xdst; in xfrm_bundle_ok()
3911 if (xdst->child_mtu_cached != mtu) { in xfrm_bundle_ok()
3913 xdst->child_mtu_cached = mtu; in xfrm_bundle_ok()
3916 if (!dst_check(xdst->route, xdst->route_cookie)) in xfrm_bundle_ok()
3918 mtu = dst_mtu(xdst->route); in xfrm_bundle_ok()
3919 if (xdst->route_mtu_cached != mtu) { in xfrm_bundle_ok()
3921 xdst->route_mtu_cached = mtu; in xfrm_bundle_ok()
3930 xdst = bundle[start_from - 1]; in xfrm_bundle_ok()
3931 mtu = xdst->child_mtu_cached; in xfrm_bundle_ok()
3933 dst = &xdst->u.dst; in xfrm_bundle_ok()
3936 if (mtu > xdst->route_mtu_cached) in xfrm_bundle_ok()
3937 mtu = xdst->route_mtu_cached; in xfrm_bundle_ok()
3942 xdst = bundle[start_from - 1]; in xfrm_bundle_ok()
3943 xdst->child_mtu_cached = mtu; in xfrm_bundle_ok()