Lines Matching refs:pols
1451 xfrm_tmpl_resolve(struct xfrm_policy **pols, int npols, const struct flowi *fl, in xfrm_tmpl_resolve() argument
1462 if (cnx + pols[i]->xfrm_nr >= XFRM_MAX_DEPTH) { in xfrm_tmpl_resolve()
1467 ret = xfrm_tmpl_resolve_one(pols[i], fl, &tpp[cnx], family); in xfrm_tmpl_resolve()
1798 struct xfrm_policy **pols, in xfrm_expand_policies() argument
1803 if (*num_pols == 0 || !pols[0]) { in xfrm_expand_policies()
1808 if (IS_ERR(pols[0])) in xfrm_expand_policies()
1809 return PTR_ERR(pols[0]); in xfrm_expand_policies()
1811 *num_xfrms = pols[0]->xfrm_nr; in xfrm_expand_policies()
1814 if (pols[0] && pols[0]->action == XFRM_POLICY_ALLOW && in xfrm_expand_policies()
1815 pols[0]->type != XFRM_POLICY_TYPE_MAIN) { in xfrm_expand_policies()
1816 pols[1] = xfrm_policy_lookup_bytype(xp_net(pols[0]), in xfrm_expand_policies()
1820 if (pols[1]) { in xfrm_expand_policies()
1821 if (IS_ERR(pols[1])) { in xfrm_expand_policies()
1822 xfrm_pols_put(pols, *num_pols); in xfrm_expand_policies()
1823 return PTR_ERR(pols[1]); in xfrm_expand_policies()
1826 (*num_xfrms) += pols[1]->xfrm_nr; in xfrm_expand_policies()
1831 if (pols[i]->action != XFRM_POLICY_ALLOW) { in xfrm_expand_policies()
1842 xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols, in xfrm_resolve_and_create_bundle() argument
1846 struct net *net = xp_net(pols[0]); in xfrm_resolve_and_create_bundle()
1853 err = xfrm_tmpl_resolve(pols, num_pols, fl, xfrm, family); in xfrm_resolve_and_create_bundle()
1860 dst = xfrm_bundle_create(pols[0], xfrm, err, fl, dst_orig); in xfrm_resolve_and_create_bundle()
1869 err = xfrm_dst_update_parent(dst, &pols[1]->selector); in xfrm_resolve_and_create_bundle()
1879 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols); in xfrm_resolve_and_create_bundle()
1880 xdst->policy_genid = atomic_read(&pols[0]->genid); in xfrm_resolve_and_create_bundle()
1967 struct xfrm_policy *pol = xdst->pols[0]; in xdst_queue_output()
2068 struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX]; in xfrm_bundle_lookup() local
2080 pols[i] = xdst->pols[i]; in xfrm_bundle_lookup()
2081 pol_dead |= pols[i]->walk.dead; in xfrm_bundle_lookup()
2096 pols[0] = __xfrm_policy_lookup(net, fl, family, in xfrm_bundle_lookup()
2098 err = xfrm_expand_policies(fl, family, pols, in xfrm_bundle_lookup()
2108 new_xdst = xfrm_resolve_and_create_bundle(pols, num_pols, fl, family, in xfrm_bundle_lookup()
2145 xfrm_pols_put(pols, num_pols); in xfrm_bundle_lookup()
2150 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols); in xfrm_bundle_lookup()
2161 xfrm_pols_put(pols, num_pols); in xfrm_bundle_lookup()
2191 struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX]; in xfrm_lookup() local
2205 pols[0] = xfrm_sk_policy_lookup(sk, XFRM_POLICY_OUT, fl); in xfrm_lookup()
2206 err = xfrm_expand_policies(fl, family, pols, in xfrm_lookup()
2218 pols, num_pols, fl, in xfrm_lookup()
2221 xfrm_pols_put(pols, num_pols); in xfrm_lookup()
2259 memcpy(pols, xdst->pols, sizeof(struct xfrm_policy *) * num_pols); in xfrm_lookup()
2288 !(pols[0]->flags & XFRM_POLICY_ICMP)) { in xfrm_lookup()
2294 pols[i]->curlft.use_time = get_seconds(); in xfrm_lookup()
2310 xfrm_pols_put(pols, drop_pols); in xfrm_lookup()
2327 xfrm_pols_put(pols, drop_pols); in xfrm_lookup()
2448 struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX]; in __xfrm_policy_check() local
2517 pols[0] = pol; in __xfrm_policy_check()
2520 if (pols[0]->type != XFRM_POLICY_TYPE_MAIN) { in __xfrm_policy_check()
2521 pols[1] = xfrm_policy_lookup_bytype(net, XFRM_POLICY_TYPE_MAIN, in __xfrm_policy_check()
2524 if (pols[1]) { in __xfrm_policy_check()
2525 if (IS_ERR(pols[1])) { in __xfrm_policy_check()
2529 pols[1]->curlft.use_time = get_seconds(); in __xfrm_policy_check()
2548 if (pols[pi] != pol && in __xfrm_policy_check()
2549 pols[pi]->action != XFRM_POLICY_ALLOW) { in __xfrm_policy_check()
2553 if (ti + pols[pi]->xfrm_nr >= XFRM_MAX_DEPTH) { in __xfrm_policy_check()
2557 for (i = 0; i < pols[pi]->xfrm_nr; i++) in __xfrm_policy_check()
2558 tpp[ti++] = &pols[pi]->xfrm_vec[i]; in __xfrm_policy_check()
2588 xfrm_pols_put(pols, npols); in __xfrm_policy_check()
2596 xfrm_pols_put(pols, npols); in __xfrm_policy_check()
2746 xdst->policy_genid != atomic_read(&xdst->pols[0]->genid)) in xfrm_bundle_ok()