summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_pcb.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r--sys/netinet/in_pcb.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 94460bb..b507fbf 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -602,7 +602,7 @@ in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, struct in_addr *laddr,
goto done;
}
- if (cred == NULL || !jailed(cred)) {
+ if (cred == NULL || !prison_flag(cred, PR_IP4)) {
laddr->s_addr = ia->ia_addr.sin_addr.s_addr;
goto done;
}
@@ -646,7 +646,7 @@ in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, struct in_addr *laddr,
struct ifnet *ifp;
/* If not jailed, use the default returned. */
- if (cred == NULL || !jailed(cred)) {
+ if (cred == NULL || !prison_flag(cred, PR_IP4)) {
ia = (struct in_ifaddr *)sro.ro_rt->rt_ifa;
laddr->s_addr = ia->ia_addr.sin_addr.s_addr;
goto done;
@@ -711,7 +711,7 @@ in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, struct in_addr *laddr,
if (ia == NULL)
ia = ifatoia(ifa_ifwithnet(sintosa(&sain)));
- if (cred == NULL || !jailed(cred)) {
+ if (cred == NULL || !prison_flag(cred, PR_IP4)) {
#if __FreeBSD_version < 800000
if (ia == NULL)
ia = (struct in_ifaddr *)sro.ro_rt->rt_ifa;
@@ -1222,7 +1222,8 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct in_addr laddr,
* Found?
*/
if (cred == NULL ||
- inp->inp_cred->cr_prison == cred->cr_prison)
+ prison_equal_ip4(cred->cr_prison,
+ inp->inp_cred->cr_prison))
return (inp);
}
}
@@ -1254,7 +1255,8 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct in_addr laddr,
LIST_FOREACH(inp, &phd->phd_pcblist, inp_portlist) {
wildcard = 0;
if (cred != NULL &&
- inp->inp_cred->cr_prison != cred->cr_prison)
+ !prison_equal_ip4(inp->inp_cred->cr_prison,
+ cred->cr_prison))
continue;
#ifdef INET6
/* XXX inp locking */
@@ -1335,7 +1337,7 @@ in_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in_addr faddr,
* the inp here, without any checks.
* Well unless both bound with SO_REUSEPORT?
*/
- if (jailed(inp->inp_cred))
+ if (prison_flag(inp->inp_cred, PR_IP4))
return (inp);
if (tmpinp == NULL)
tmpinp = inp;
@@ -1380,7 +1382,7 @@ in_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in_addr faddr,
(inp->inp_flags & INP_FAITH) == 0)
continue;
- injail = jailed(inp->inp_cred);
+ injail = prison_flag(inp->inp_cred, PR_IP4);
if (injail) {
if (prison_check_ip4(inp->inp_cred,
&laddr) != 0)
OpenPOWER on IntegriCloud