Lines Matching defs:pols
2503 xfrm_tmpl_resolve(struct xfrm_policy **pols, int npols, const struct flowi *fl,
2514 if (cnx + pols[i]->xfrm_nr >= XFRM_MAX_DEPTH) {
2519 ret = xfrm_tmpl_resolve_one(pols[i], fl, &tpp[cnx], family);
2754 struct xfrm_policy **pols,
2759 if (*num_pols == 0 || !pols[0]) {
2764 if (IS_ERR(pols[0])) {
2766 return PTR_ERR(pols[0]);
2769 *num_xfrms = pols[0]->xfrm_nr;
2772 if (pols[0]->action == XFRM_POLICY_ALLOW &&
2773 pols[0]->type != XFRM_POLICY_TYPE_MAIN) {
2774 pols[1] = xfrm_policy_lookup_bytype(xp_net(pols[0]),
2778 pols[0]->if_id);
2779 if (pols[1]) {
2780 if (IS_ERR(pols[1])) {
2781 xfrm_pols_put(pols, *num_pols);
2783 return PTR_ERR(pols[1]);
2786 (*num_xfrms) += pols[1]->xfrm_nr;
2791 if (pols[i]->action != XFRM_POLICY_ALLOW) {
2802 xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols,
2806 struct net *net = xp_net(pols[0]);
2814 err = xfrm_tmpl_resolve(pols, num_pols, fl, xfrm, family);
2824 dst = xfrm_bundle_create(pols[0], xfrm, bundle, err, fl, dst_orig);
2833 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols);
2834 xdst->policy_genid = atomic_read(&pols[0]->genid);
2931 struct xfrm_policy *pol = xdst->pols[0];
3032 struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX];
3039 pols[0] = xfrm_policy_lookup(net, fl, family, dir, if_id);
3040 err = xfrm_expand_policies(fl, family, pols,
3049 xdst = xfrm_resolve_and_create_bundle(pols, num_pols, fl, family,
3054 xfrm_pols_put(pols, num_pols);
3074 xfrm_pols_put(pols, num_pols);
3079 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols);
3086 xfrm_pols_put(pols, num_pols);
3121 struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX];
3135 pols[0] = xfrm_sk_policy_lookup(sk, XFRM_POLICY_OUT, fl, family,
3137 err = xfrm_expand_policies(fl, family, pols,
3149 pols, num_pols, fl,
3153 xfrm_pols_put(pols, num_pols);
3190 memcpy(pols, xdst->pols, sizeof(struct xfrm_policy *) * num_pols);
3219 !(pols[0]->flags & XFRM_POLICY_ICMP)) {
3225 WRITE_ONCE(pols[i]->curlft.use_time, ktime_get_real_seconds());
3241 xfrm_pols_put(pols, drop_pols);
3263 xfrm_pols_put(pols, drop_pols);
3601 struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX];
3684 pols[0] = pol;
3687 if (pols[0]->type != XFRM_POLICY_TYPE_MAIN) {
3688 pols[1] = xfrm_policy_lookup_bytype(net, XFRM_POLICY_TYPE_MAIN,
3691 if (pols[1]) {
3692 if (IS_ERR(pols[1])) {
3694 xfrm_pol_put(pols[0]);
3698 WRITE_ONCE(pols[1]->curlft.use_time,
3718 if (pols[pi] != pol &&
3719 pols[pi]->action != XFRM_POLICY_ALLOW) {
3723 if (ti + pols[pi]->xfrm_nr >= XFRM_MAX_DEPTH) {
3727 for (i = 0; i < pols[pi]->xfrm_nr; i++)
3728 tpp[ti++] = &pols[pi]->xfrm_vec[i];
3762 xfrm_pols_put(pols, npols);
3772 xfrm_pols_put(pols, npols);
3918 xdst->policy_genid != atomic_read(&xdst->pols[0]->genid))