summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-02-27 18:32:23 +0000
committerjhb <jhb@FreeBSD.org>2002-02-27 18:32:23 +0000
commit3706cd350927f08fa8742cce9448c9ba8e4d6b2c (patch)
treede74317436bc6bf8211535e1dbda3f6762d05582 /sys/netinet
parentec01b5bdbc40025303ba133be03a747c8dc62a2c (diff)
downloadFreeBSD-src-3706cd350927f08fa8742cce9448c9ba8e4d6b2c.zip
FreeBSD-src-3706cd350927f08fa8742cce9448c9ba8e4d6b2c.tar.gz
Simple p_ucred -> td_ucred changes to start using the per-thread ucred
reference.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/in_pcb.c10
-rw-r--r--sys/netinet/ip_dummynet.c2
-rw-r--r--sys/netinet/ip_fw.c2
-rw-r--r--sys/netinet/raw_ip.c2
-rw-r--r--sys/netinet/tcp_subr.c6
-rw-r--r--sys/netinet/tcp_timewait.c6
-rw-r--r--sys/netinet/tcp_usrreq.c4
-rw-r--r--sys/netinet/udp_usrreq.c12
8 files changed, 22 insertions, 22 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 59aec2e..7d5a745 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -206,7 +206,7 @@ in_pcbbind(inp, nam, td)
return (EAFNOSUPPORT);
#endif
if (sin->sin_addr.s_addr != INADDR_ANY)
- if (prison_ip(p->p_ucred, 0, &sin->sin_addr.s_addr))
+ if (prison_ip(td->td_ucred, 0, &sin->sin_addr.s_addr))
return(EINVAL);
lport = sin->sin_port;
if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) {
@@ -231,7 +231,7 @@ in_pcbbind(inp, nam, td)
if (ntohs(lport) < IPPORT_RESERVED && p &&
suser_xxx(0, p, PRISON_ROOT))
return (EACCES);
- if (p && jailed(p->p_ucred))
+ if (td && jailed(td->td_ucred))
prison = 1;
if (so->so_cred->cr_uid != 0 &&
!IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) {
@@ -257,7 +257,7 @@ in_pcbbind(inp, nam, td)
}
}
if (prison &&
- prison_ip(p->p_ucred, 0, &sin->sin_addr.s_addr))
+ prison_ip(td->td_ucred, 0, &sin->sin_addr.s_addr))
return (EADDRNOTAVAIL);
t = in_pcblookup_local(pcbinfo, sin->sin_addr,
lport, prison ? 0 : wild);
@@ -281,7 +281,7 @@ in_pcbbind(inp, nam, td)
int count;
if (inp->inp_laddr.s_addr != INADDR_ANY)
- if (prison_ip(p->p_ucred, 0, &inp->inp_laddr.s_addr )) {
+ if (prison_ip(td->td_ucred, 0, &inp->inp_laddr.s_addr )) {
inp->inp_laddr.s_addr = INADDR_ANY;
return (EINVAL);
}
@@ -352,7 +352,7 @@ in_pcbbind(inp, nam, td)
}
}
inp->inp_lport = lport;
- if (prison_ip(p->p_ucred, 0, &inp->inp_laddr.s_addr)) {
+ if (prison_ip(td->td_ucred, 0, &inp->inp_laddr.s_addr)) {
inp->inp_laddr.s_addr = INADDR_ANY;
inp->inp_lport = 0;
return (EINVAL);
diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c
index bb3c409..5da5ea8 100644
--- a/sys/netinet/ip_dummynet.c
+++ b/sys/netinet/ip_dummynet.c
@@ -1830,7 +1830,7 @@ ip_dn_ctl(struct sockopt *sopt)
/* Disallow sets in really-really secure mode. */
if (sopt->sopt_dir == SOPT_SET) {
- error = securelevel_ge(sopt->sopt_td->td_proc->p_ucred, 3);
+ error = securelevel_ge(sopt->sopt_td->td_ucred, 3);
if (error)
return (error);
}
diff --git a/sys/netinet/ip_fw.c b/sys/netinet/ip_fw.c
index 01908d7..744e2da 100644
--- a/sys/netinet/ip_fw.c
+++ b/sys/netinet/ip_fw.c
@@ -1940,7 +1940,7 @@ ip_fw_ctl(struct sockopt *sopt)
*/
if (sopt->sopt_name == IP_FW_ADD ||
(sopt->sopt_dir == SOPT_SET && sopt->sopt_name != IP_FW_RESETLOG)) {
- error = securelevel_ge(sopt->sopt_td->td_proc->p_ucred, 3);
+ error = securelevel_ge(sopt->sopt_td->td_ucred, 3);
if (error)
return (error);
}
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index e9a6ff1..709a919 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -628,7 +628,7 @@ rip_pcblist(SYSCTL_HANDLER_ARGS)
for (inp = LIST_FIRST(ripcbinfo.listhead), i = 0; inp && i < n;
inp = LIST_NEXT(inp, inp_list)) {
if (inp->inp_gencnt <= gencnt) {
- if (cr_cansee(req->td->td_proc->p_ucred,
+ if (cr_cansee(req->td->td_ucred,
inp->inp_socket->so_cred))
continue;
inp_list[i++] = inp;
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 99b08c4..94773d2 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -848,7 +848,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
for (inp = LIST_FIRST(tcbinfo.listhead), i = 0; inp && i < n;
inp = LIST_NEXT(inp, inp_list)) {
if (inp->inp_gencnt <= gencnt) {
- if (cr_cansee(req->td->td_proc->p_ucred,
+ if (cr_cansee(req->td->td_ucred,
inp->inp_socket->so_cred))
continue;
inp_list[i++] = inp;
@@ -919,7 +919,7 @@ tcp_getcred(SYSCTL_HANDLER_ARGS)
error = ENOENT;
goto out;
}
- error = cr_cansee(req->td->td_proc->p_ucred, inp->inp_socket->so_cred);
+ error = cr_cansee(req->td->td_ucred, inp->inp_socket->so_cred);
if (error)
goto out;
cru2x(inp->inp_socket->so_cred, &xuc);
@@ -971,7 +971,7 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS)
error = ENOENT;
goto out;
}
- error = cr_cansee(req->td->td_proc->p_ucred, inp->inp_socket->so_cred);
+ error = cr_cansee(req->td->td_ucred, inp->inp_socket->so_cred);
if (error)
goto out;
cru2x(inp->inp_socket->so_cred, &xuc);
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index 99b08c4..94773d2 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -848,7 +848,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
for (inp = LIST_FIRST(tcbinfo.listhead), i = 0; inp && i < n;
inp = LIST_NEXT(inp, inp_list)) {
if (inp->inp_gencnt <= gencnt) {
- if (cr_cansee(req->td->td_proc->p_ucred,
+ if (cr_cansee(req->td->td_ucred,
inp->inp_socket->so_cred))
continue;
inp_list[i++] = inp;
@@ -919,7 +919,7 @@ tcp_getcred(SYSCTL_HANDLER_ARGS)
error = ENOENT;
goto out;
}
- error = cr_cansee(req->td->td_proc->p_ucred, inp->inp_socket->so_cred);
+ error = cr_cansee(req->td->td_ucred, inp->inp_socket->so_cred);
if (error)
goto out;
cru2x(inp->inp_socket->so_cred, &xuc);
@@ -971,7 +971,7 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS)
error = ENOENT;
goto out;
}
- error = cr_cansee(req->td->td_proc->p_ucred, inp->inp_socket->so_cred);
+ error = cr_cansee(req->td->td_ucred, inp->inp_socket->so_cred);
if (error)
goto out;
cru2x(inp->inp_socket->so_cred, &xuc);
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index e3a35d7..c3aa59f 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -330,8 +330,8 @@ tcp_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
goto out;
}
- if (td && jailed(td->td_proc->p_ucred))
- prison_remote_ip(td->td_proc->p_ucred, 0, &sinp->sin_addr.s_addr);
+ if (td && jailed(td->td_ucred))
+ prison_remote_ip(td->td_ucred, 0, &sinp->sin_addr.s_addr);
if ((error = tcp_connect(tp, nam, td)) != 0)
goto out;
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 047a5d4..3f98ea7 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -583,7 +583,7 @@ udp_pcblist(SYSCTL_HANDLER_ARGS)
for (inp = LIST_FIRST(udbinfo.listhead), i = 0; inp && i < n;
inp = LIST_NEXT(inp, inp_list)) {
if (inp->inp_gencnt <= gencnt) {
- if (cr_cansee(req->td->td_proc->p_ucred,
+ if (cr_cansee(req->td->td_ucred,
inp->inp_socket->so_cred))
continue;
inp_list[i++] = inp;
@@ -648,7 +648,7 @@ udp_getcred(SYSCTL_HANDLER_ARGS)
error = ENOENT;
goto out;
}
- error = cr_cansee(req->td->td_proc->p_ucred, inp->inp_socket->so_cred);
+ error = cr_cansee(req->td->td_ucred, inp->inp_socket->so_cred);
if (error)
goto out;
cru2x(inp->inp_socket->so_cred, &xuc);
@@ -686,8 +686,8 @@ udp_output(inp, m, addr, control, td)
if (addr) {
sin = (struct sockaddr_in *)addr;
- if (td && jailed(td->td_proc->p_ucred))
- prison_remote_ip(td->td_proc->p_ucred, 0, &sin->sin_addr.s_addr);
+ if (td && jailed(td->td_ucred))
+ prison_remote_ip(td->td_ucred, 0, &sin->sin_addr.s_addr);
laddr = inp->inp_laddr;
if (inp->inp_faddr.s_addr != INADDR_ANY) {
error = EISCONN;
@@ -856,8 +856,8 @@ udp_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
return EISCONN;
s = splnet();
sin = (struct sockaddr_in *)nam;
- if (td && jailed(td->td_proc->p_ucred))
- prison_remote_ip(td->td_proc->p_ucred, 0, &sin->sin_addr.s_addr);
+ if (td && jailed(td->td_ucred))
+ prison_remote_ip(td->td_ucred, 0, &sin->sin_addr.s_addr);
error = in_pcbconnect(inp, nam, td);
splx(s);
if (error == 0)
OpenPOWER on IntegriCloud