Lines Matching refs:pols

1472 xfrm_tmpl_resolve(struct xfrm_policy **pols, int npols, const struct flowi *fl,  in xfrm_tmpl_resolve()  argument
1483 if (cnx + pols[i]->xfrm_nr >= XFRM_MAX_DEPTH) { in xfrm_tmpl_resolve()
1488 ret = xfrm_tmpl_resolve_one(pols[i], fl, &tpp[cnx], family); in xfrm_tmpl_resolve()
1817 struct xfrm_policy **pols, in xfrm_expand_policies() argument
1822 if (*num_pols == 0 || !pols[0]) { in xfrm_expand_policies()
1827 if (IS_ERR(pols[0])) in xfrm_expand_policies()
1828 return PTR_ERR(pols[0]); in xfrm_expand_policies()
1830 *num_xfrms = pols[0]->xfrm_nr; in xfrm_expand_policies()
1833 if (pols[0] && pols[0]->action == XFRM_POLICY_ALLOW && in xfrm_expand_policies()
1834 pols[0]->type != XFRM_POLICY_TYPE_MAIN) { in xfrm_expand_policies()
1835 pols[1] = xfrm_policy_lookup_bytype(xp_net(pols[0]), in xfrm_expand_policies()
1839 if (pols[1]) { in xfrm_expand_policies()
1840 if (IS_ERR(pols[1])) { in xfrm_expand_policies()
1841 xfrm_pols_put(pols, *num_pols); in xfrm_expand_policies()
1842 return PTR_ERR(pols[1]); in xfrm_expand_policies()
1845 (*num_xfrms) += pols[1]->xfrm_nr; in xfrm_expand_policies()
1850 if (pols[i]->action != XFRM_POLICY_ALLOW) { in xfrm_expand_policies()
1861 xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols, in xfrm_resolve_and_create_bundle() argument
1865 struct net *net = xp_net(pols[0]); in xfrm_resolve_and_create_bundle()
1872 err = xfrm_tmpl_resolve(pols, num_pols, fl, xfrm, family); in xfrm_resolve_and_create_bundle()
1879 dst = xfrm_bundle_create(pols[0], xfrm, err, fl, dst_orig); in xfrm_resolve_and_create_bundle()
1888 err = xfrm_dst_update_parent(dst, &pols[1]->selector); in xfrm_resolve_and_create_bundle()
1898 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols); in xfrm_resolve_and_create_bundle()
1899 xdst->policy_genid = atomic_read(&pols[0]->genid); in xfrm_resolve_and_create_bundle()
1985 struct xfrm_policy *pol = xdst->pols[0]; in xdst_queue_output()
2086 struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX]; in xfrm_bundle_lookup() local
2098 pols[i] = xdst->pols[i]; in xfrm_bundle_lookup()
2099 pol_dead |= pols[i]->walk.dead; in xfrm_bundle_lookup()
2114 pols[0] = __xfrm_policy_lookup(net, fl, family, in xfrm_bundle_lookup()
2116 err = xfrm_expand_policies(fl, family, pols, in xfrm_bundle_lookup()
2126 new_xdst = xfrm_resolve_and_create_bundle(pols, num_pols, fl, family, in xfrm_bundle_lookup()
2163 xfrm_pols_put(pols, num_pols); in xfrm_bundle_lookup()
2168 memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols); in xfrm_bundle_lookup()
2179 xfrm_pols_put(pols, num_pols); in xfrm_bundle_lookup()
2209 struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX]; in xfrm_lookup() local
2224 pols[0] = xfrm_sk_policy_lookup(sk, XFRM_POLICY_OUT, fl); in xfrm_lookup()
2225 err = xfrm_expand_policies(fl, family, pols, in xfrm_lookup()
2237 pols, num_pols, fl, in xfrm_lookup()
2240 xfrm_pols_put(pols, num_pols); in xfrm_lookup()
2278 memcpy(pols, xdst->pols, sizeof(struct xfrm_policy *) * num_pols); in xfrm_lookup()
2307 !(pols[0]->flags & XFRM_POLICY_ICMP)) { in xfrm_lookup()
2313 pols[i]->curlft.use_time = get_seconds(); in xfrm_lookup()
2329 xfrm_pols_put(pols, drop_pols); in xfrm_lookup()
2346 xfrm_pols_put(pols, drop_pols); in xfrm_lookup()
2467 struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX]; in __xfrm_policy_check() local
2537 pols[0] = pol; in __xfrm_policy_check()
2540 if (pols[0]->type != XFRM_POLICY_TYPE_MAIN) { in __xfrm_policy_check()
2541 pols[1] = xfrm_policy_lookup_bytype(net, XFRM_POLICY_TYPE_MAIN, in __xfrm_policy_check()
2544 if (pols[1]) { in __xfrm_policy_check()
2545 if (IS_ERR(pols[1])) { in __xfrm_policy_check()
2549 pols[1]->curlft.use_time = get_seconds(); in __xfrm_policy_check()
2568 if (pols[pi] != pol && in __xfrm_policy_check()
2569 pols[pi]->action != XFRM_POLICY_ALLOW) { in __xfrm_policy_check()
2573 if (ti + pols[pi]->xfrm_nr >= XFRM_MAX_DEPTH) { in __xfrm_policy_check()
2577 for (i = 0; i < pols[pi]->xfrm_nr; i++) in __xfrm_policy_check()
2578 tpp[ti++] = &pols[pi]->xfrm_vec[i]; in __xfrm_policy_check()
2608 xfrm_pols_put(pols, npols); in __xfrm_policy_check()
2616 xfrm_pols_put(pols, npols); in __xfrm_policy_check()
2766 xdst->policy_genid != atomic_read(&xdst->pols[0]->genid)) in xfrm_bundle_ok()