Lines Matching full:pr

66 prison_primary_ip4(const struct prison *pr)  in prison_primary_ip4()  argument
69 return (((const struct in_addr *)prison_ip_get0(pr, PR_INET))->s_addr); in prison_primary_ip4()
121 struct prison *pr; in prison_get_ip4() local
126 pr = cred->cr_prison; in prison_get_ip4()
127 if (!(pr->pr_flags & PR_IP4)) in prison_get_ip4()
129 mtx_lock(&pr->pr_mtx); in prison_get_ip4()
130 if (!(pr->pr_flags & PR_IP4)) { in prison_get_ip4()
131 mtx_unlock(&pr->pr_mtx); in prison_get_ip4()
134 if (pr->pr_addrs[PR_INET] == NULL) { in prison_get_ip4()
135 mtx_unlock(&pr->pr_mtx); in prison_get_ip4()
139 ia->s_addr = prison_primary_ip4(pr); in prison_get_ip4()
140 mtx_unlock(&pr->pr_mtx); in prison_get_ip4()
154 struct prison *pr; in prison_saddrsel_ip4() local
163 pr = cred->cr_prison; in prison_saddrsel_ip4()
164 if (pr->pr_flags & PR_IP4_SADDRSEL) in prison_saddrsel_ip4()
217 struct prison *pr; in prison_local_ip4() local
224 pr = cred->cr_prison; in prison_local_ip4()
225 if (!(pr->pr_flags & PR_IP4)) in prison_local_ip4()
227 mtx_lock(&pr->pr_mtx); in prison_local_ip4()
228 if (!(pr->pr_flags & PR_IP4)) { in prison_local_ip4()
229 mtx_unlock(&pr->pr_mtx); in prison_local_ip4()
232 if (pr->pr_addrs[PR_INET] == NULL) { in prison_local_ip4()
233 mtx_unlock(&pr->pr_mtx); in prison_local_ip4()
243 if (prison_ip_cnt(pr, PR_INET) == 1) in prison_local_ip4()
244 ia->s_addr = prison_primary_ip4(pr); in prison_local_ip4()
245 mtx_unlock(&pr->pr_mtx); in prison_local_ip4()
249 error = prison_check_ip4_locked(pr, ia); in prison_local_ip4()
251 ia->s_addr = prison_primary_ip4(pr); in prison_local_ip4()
255 mtx_unlock(&pr->pr_mtx); in prison_local_ip4()
268 struct prison *pr; in prison_remote_ip4() local
273 pr = cred->cr_prison; in prison_remote_ip4()
274 if (!(pr->pr_flags & PR_IP4)) in prison_remote_ip4()
276 mtx_lock(&pr->pr_mtx); in prison_remote_ip4()
277 if (!(pr->pr_flags & PR_IP4)) { in prison_remote_ip4()
278 mtx_unlock(&pr->pr_mtx); in prison_remote_ip4()
281 if (pr->pr_addrs[PR_INET] == NULL) { in prison_remote_ip4()
282 mtx_unlock(&pr->pr_mtx); in prison_remote_ip4()
287 prison_check_ip4_locked(pr, ia) == EADDRNOTAVAIL) { in prison_remote_ip4()
288 ia->s_addr = prison_primary_ip4(pr); in prison_remote_ip4()
289 mtx_unlock(&pr->pr_mtx); in prison_remote_ip4()
296 mtx_unlock(&pr->pr_mtx); in prison_remote_ip4()
307 prison_check_ip4_locked(const struct prison *pr, const struct in_addr *ia) in prison_check_ip4_locked() argument
310 if (!(pr->pr_flags & PR_IP4)) in prison_check_ip4_locked()
313 return (prison_ip_check(pr, PR_INET, ia)); in prison_check_ip4_locked()
319 struct prison *pr; in prison_check_ip4() local
325 pr = cred->cr_prison; in prison_check_ip4()
326 if (!(pr->pr_flags & PR_IP4)) in prison_check_ip4()
328 mtx_lock(&pr->pr_mtx); in prison_check_ip4()
329 if (!(pr->pr_flags & PR_IP4)) { in prison_check_ip4()
330 mtx_unlock(&pr->pr_mtx); in prison_check_ip4()
333 if (pr->pr_addrs[PR_INET] == NULL) { in prison_check_ip4()
334 mtx_unlock(&pr->pr_mtx); in prison_check_ip4()
338 error = prison_check_ip4_locked(pr, ia); in prison_check_ip4()
339 mtx_unlock(&pr->pr_mtx); in prison_check_ip4()