Lines Matching refs:xdst

166 static int xfrm_bundle_ok(struct xfrm_dst *xdst);
2471 struct xfrm_dst *xdst;
2488 xdst = dst_alloc(dst_ops, NULL, 1, DST_OBSOLETE_NONE, 0);
2490 if (likely(xdst)) {
2491 struct dst_entry *dst = &xdst->u.dst;
2493 memset(dst + 1, 0, sizeof(*xdst) - sizeof(*dst));
2495 xdst = ERR_PTR(-ENOBUFS);
2499 return xdst;
2512 static inline int xfrm_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
2516 xfrm_policy_get_afinfo(xdst->u.dst.ops->family);
2522 err = afinfo->fill_dst(xdst, dev, fl);
2564 struct xfrm_dst *xdst = xfrm_alloc_dst(net, family);
2565 struct dst_entry *dst1 = &xdst->u.dst;
2567 err = PTR_ERR(xdst);
2568 if (IS_ERR(xdst)) {
2573 bundle[i] = xdst;
2575 xdst0 = xdst;
2580 xfrm_dst_set_child(xdst_prev, &xdst->u.dst);
2593 xdst->route = dst;
2612 xdst->xfrm_genid = xfrm[i]->genid;
2627 xdst_prev = xdst;
2726 struct xfrm_dst *xdst;
2747 xdst = (struct xfrm_dst *)dst;
2748 xdst->num_xfrms = err;
2749 xdst->num_pols = num_pols;
2750 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols);
2751 xdst->policy_genid = atomic_read(&pols[0]->genid);
2753 return xdst;
2847 struct xfrm_dst *xdst = (struct xfrm_dst *) dst;
2848 struct xfrm_policy *pol = xdst->pols[0];
2895 struct xfrm_dst *xdst;
2897 xdst = xfrm_alloc_dst(net, family);
2898 if (IS_ERR(xdst))
2899 return xdst;
2904 return xdst;
2907 dst1 = &xdst->u.dst;
2909 xdst->route = dst;
2921 xfrm_dst_set_child(xdst, dst);
2922 xdst->path = dst;
2931 err = xfrm_fill_dst(xdst, dev, fl);
2936 return xdst;
2940 xdst = ERR_PTR(err);
2951 struct xfrm_dst *xdst;
2966 xdst = xfrm_resolve_and_create_bundle(pols, num_pols, fl, family,
2968 if (IS_ERR(xdst)) {
2969 err = PTR_ERR(xdst);
2978 } else if (xdst == NULL) {
2983 return xdst;
2989 xdst = xfrm_create_dummy_bundle(net, xflo, fl, num_xfrms, family);
2990 if (IS_ERR(xdst)) {
2992 return ERR_CAST(xdst);
2994 xdst->num_pols = num_pols;
2995 xdst->num_xfrms = num_xfrms;
2996 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols);
2998 return xdst;
3039 struct xfrm_dst *xdst;
3046 xdst = NULL;
3065 xdst = xfrm_resolve_and_create_bundle(
3069 if (IS_ERR(xdst)) {
3071 err = PTR_ERR(xdst);
3076 } else if (xdst == NULL) {
3082 route = xdst->route;
3086 if (xdst == NULL) {
3097 xdst = xfrm_bundle_lookup(net, fl, family, dir, &xflo, if_id);
3098 if (xdst == NULL)
3100 if (IS_ERR(xdst)) {
3101 err = PTR_ERR(xdst);
3105 num_pols = xdst->num_pols;
3106 num_xfrms = xdst->num_xfrms;
3107 memcpy(pols, xdst->pols, sizeof(struct xfrm_policy *) * num_pols);
3108 route = xdst->route;
3111 dst = &xdst->u.dst;
3774 * X is the "xdst->route" of A (X is also the "dst->path" of A
3781 * This will force stale_bundle() to fail on any xdst bundle with
3819 struct xfrm_dst *xdst = bundle[nr];
3823 dst = &xdst->u.dst;
3825 xdst->child_mtu_cached = pmtu;
3829 route_mtu_cached = dst_mtu(xdst->route);
3830 xdst->route_mtu_cached = route_mtu_cached;
3847 struct xfrm_dst *xdst;
3860 struct xfrm_dst *xdst = (struct xfrm_dst *)dst;
3864 if (xdst->xfrm_genid != dst->xfrm->genid)
3866 if (xdst->num_pols > 0 &&
3867 xdst->policy_genid != atomic_read(&xdst->pols[0]->genid))
3870 bundle[nr++] = xdst;
3873 if (xdst->child_mtu_cached != mtu) {
3875 xdst->child_mtu_cached = mtu;
3878 if (!dst_check(xdst->route, xdst->route_cookie))
3880 mtu = dst_mtu(xdst->route);
3881 if (xdst->route_mtu_cached != mtu) {
3883 xdst->route_mtu_cached = mtu;
3892 xdst = bundle[start_from - 1];
3893 mtu = xdst->child_mtu_cached;
3895 dst = &xdst->u.dst;
3898 if (mtu > xdst->route_mtu_cached)
3899 mtu = xdst->route_mtu_cached;
3904 xdst = bundle[start_from - 1];
3905 xdst->child_mtu_cached = mtu;