Lines Matching defs:pols
2422 xfrm_tmpl_resolve(struct xfrm_policy **pols, int npols, const struct flowi *fl,
2433 if (cnx + pols[i]->xfrm_nr >= XFRM_MAX_DEPTH) {
2438 ret = xfrm_tmpl_resolve_one(pols[i], fl, &tpp[cnx], family);
2671 struct xfrm_policy **pols,
2676 if (*num_pols == 0 || !pols[0]) {
2681 if (IS_ERR(pols[0])) {
2683 return PTR_ERR(pols[0]);
2686 *num_xfrms = pols[0]->xfrm_nr;
2689 if (pols[0] && pols[0]->action == XFRM_POLICY_ALLOW &&
2690 pols[0]->type != XFRM_POLICY_TYPE_MAIN) {
2691 pols[1] = xfrm_policy_lookup_bytype(xp_net(pols[0]),
2695 pols[0]->if_id);
2696 if (pols[1]) {
2697 if (IS_ERR(pols[1])) {
2698 xfrm_pols_put(pols, *num_pols);
2700 return PTR_ERR(pols[1]);
2703 (*num_xfrms) += pols[1]->xfrm_nr;
2708 if (pols[i]->action != XFRM_POLICY_ALLOW) {
2719 xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols,
2723 struct net *net = xp_net(pols[0]);
2731 err = xfrm_tmpl_resolve(pols, num_pols, fl, xfrm, family);
2741 dst = xfrm_bundle_create(pols[0], xfrm, bundle, err, fl, dst_orig);
2750 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols);
2751 xdst->policy_genid = atomic_read(&pols[0]->genid);
2848 struct xfrm_policy *pol = xdst->pols[0];
2949 struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX];
2956 pols[0] = xfrm_policy_lookup(net, fl, family, dir, if_id);
2957 err = xfrm_expand_policies(fl, family, pols,
2966 xdst = xfrm_resolve_and_create_bundle(pols, num_pols, fl, family,
2971 xfrm_pols_put(pols, num_pols);
2991 xfrm_pols_put(pols, num_pols);
2996 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols);
3003 xfrm_pols_put(pols, num_pols);
3038 struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX];
3052 pols[0] = xfrm_sk_policy_lookup(sk, XFRM_POLICY_OUT, fl, family,
3054 err = xfrm_expand_policies(fl, family, pols,
3066 pols, num_pols, fl,
3070 xfrm_pols_put(pols, num_pols);
3107 memcpy(pols, xdst->pols, sizeof(struct xfrm_policy *) * num_pols);
3136 !(pols[0]->flags & XFRM_POLICY_ICMP)) {
3142 pols[i]->curlft.use_time = ktime_get_real_seconds();
3158 xfrm_pols_put(pols, drop_pols);
3180 xfrm_pols_put(pols, drop_pols);
3558 struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX];
3640 pols[0] = pol;
3643 if (pols[0]->type != XFRM_POLICY_TYPE_MAIN) {
3644 pols[1] = xfrm_policy_lookup_bytype(net, XFRM_POLICY_TYPE_MAIN,
3647 if (pols[1]) {
3648 if (IS_ERR(pols[1])) {
3650 xfrm_pol_put(pols[0]);
3653 pols[1]->curlft.use_time = ktime_get_real_seconds();
3672 if (pols[pi] != pol &&
3673 pols[pi]->action != XFRM_POLICY_ALLOW) {
3677 if (ti + pols[pi]->xfrm_nr >= XFRM_MAX_DEPTH) {
3681 for (i = 0; i < pols[pi]->xfrm_nr; i++)
3682 tpp[ti++] = &pols[pi]->xfrm_vec[i];
3716 xfrm_pols_put(pols, npols);
3726 xfrm_pols_put(pols, npols);
3867 xdst->policy_genid != atomic_read(&xdst->pols[0]->genid))