Lines Matching refs:xdst

166 static int xfrm_bundle_ok(struct xfrm_dst *xdst);
2552 struct xfrm_dst *xdst;
2569 xdst = dst_alloc(dst_ops, NULL, 1, DST_OBSOLETE_NONE, 0);
2571 if (likely(xdst)) {
2572 memset_after(xdst, 0, u.dst);
2574 xdst = ERR_PTR(-ENOBUFS);
2578 return xdst;
2591 static inline int xfrm_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
2595 xfrm_policy_get_afinfo(xdst->u.dst.ops->family);
2601 err = afinfo->fill_dst(xdst, dev, fl);
2643 struct xfrm_dst *xdst = xfrm_alloc_dst(net, family);
2644 struct dst_entry *dst1 = &xdst->u.dst;
2646 err = PTR_ERR(xdst);
2647 if (IS_ERR(xdst)) {
2652 bundle[i] = xdst;
2654 xdst0 = xdst;
2659 xfrm_dst_set_child(xdst_prev, &xdst->u.dst);
2672 xdst->route = dst;
2695 xdst->xfrm_genid = xfrm[i]->genid;
2710 xdst_prev = xdst;
2809 struct xfrm_dst *xdst;
2830 xdst = (struct xfrm_dst *)dst;
2831 xdst->num_xfrms = err;
2832 xdst->num_pols = num_pols;
2833 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols);
2834 xdst->policy_genid = atomic_read(&pols[0]->genid);
2836 return xdst;
2930 struct xfrm_dst *xdst = (struct xfrm_dst *) dst;
2931 struct xfrm_policy *pol = xdst->pols[0];
2978 struct xfrm_dst *xdst;
2980 xdst = xfrm_alloc_dst(net, family);
2981 if (IS_ERR(xdst))
2982 return xdst;
2987 return xdst;
2990 dst1 = &xdst->u.dst;
2992 xdst->route = dst;
3004 xfrm_dst_set_child(xdst, dst);
3005 xdst->path = dst;
3014 err = xfrm_fill_dst(xdst, dev, fl);
3019 return xdst;
3023 xdst = ERR_PTR(err);
3034 struct xfrm_dst *xdst;
3049 xdst = xfrm_resolve_and_create_bundle(pols, num_pols, fl, family,
3051 if (IS_ERR(xdst)) {
3052 err = PTR_ERR(xdst);
3061 } else if (xdst == NULL) {
3066 return xdst;
3072 xdst = xfrm_create_dummy_bundle(net, xflo, fl, num_xfrms, family);
3073 if (IS_ERR(xdst)) {
3075 return ERR_CAST(xdst);
3077 xdst->num_pols = num_pols;
3078 xdst->num_xfrms = num_xfrms;
3079 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols);
3081 return xdst;
3122 struct xfrm_dst *xdst;
3129 xdst = NULL;
3148 xdst = xfrm_resolve_and_create_bundle(
3152 if (IS_ERR(xdst)) {
3154 err = PTR_ERR(xdst);
3159 } else if (xdst == NULL) {
3165 route = xdst->route;
3169 if (xdst == NULL) {
3180 xdst = xfrm_bundle_lookup(net, fl, family, dir, &xflo, if_id);
3181 if (xdst == NULL)
3183 if (IS_ERR(xdst)) {
3184 err = PTR_ERR(xdst);
3188 num_pols = xdst->num_pols;
3189 num_xfrms = xdst->num_xfrms;
3190 memcpy(pols, xdst->pols, sizeof(struct xfrm_policy *) * num_pols);
3191 route = xdst->route;
3194 dst = &xdst->u.dst;
3820 * X is the "xdst->route" of A (X is also the "dst->path" of A
3827 * This will force stale_bundle() to fail on any xdst bundle with
3870 struct xfrm_dst *xdst = bundle[nr];
3874 dst = &xdst->u.dst;
3876 xdst->child_mtu_cached = pmtu;
3880 route_mtu_cached = dst_mtu(xdst->route);
3881 xdst->route_mtu_cached = route_mtu_cached;
3898 struct xfrm_dst *xdst;
3911 struct xfrm_dst *xdst = (struct xfrm_dst *)dst;
3915 if (xdst->xfrm_genid != dst->xfrm->genid)
3917 if (xdst->num_pols > 0 &&
3918 xdst->policy_genid != atomic_read(&xdst->pols[0]->genid))
3921 bundle[nr++] = xdst;
3924 if (xdst->child_mtu_cached != mtu) {
3926 xdst->child_mtu_cached = mtu;
3929 if (!dst_check(xdst->route, xdst->route_cookie))
3931 mtu = dst_mtu(xdst->route);
3932 if (xdst->route_mtu_cached != mtu) {
3934 xdst->route_mtu_cached = mtu;
3943 xdst = bundle[start_from - 1];
3944 mtu = xdst->child_mtu_cached;
3946 dst = &xdst->u.dst;
3949 if (mtu > xdst->route_mtu_cached)
3950 mtu = xdst->route_mtu_cached;
3955 xdst = bundle[start_from - 1];
3956 xdst->child_mtu_cached = mtu;