summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2001-11-08 02:13:18 +0000
committerrwatson <rwatson@FreeBSD.org>2001-11-08 02:13:18 +0000
commit8cf42b482a9aa3f9ec41071c44bc18a0ea425abf (patch)
treef48964de5180c6b27c3272456da3b93d16bd1ea3 /sys/netinet
parentc4a9f1d3ab184e9dddf4227f8e0781b59d1a82b7 (diff)
downloadFreeBSD-src-8cf42b482a9aa3f9ec41071c44bc18a0ea425abf.zip
FreeBSD-src-8cf42b482a9aa3f9ec41071c44bc18a0ea425abf.tar.gz
o Replace reference to 'struct proc' with 'struct thread' in 'struct
sysctl_req', which describes in-progress sysctl requests. This permits sysctl handlers to have access to the current thread, permitting work on implementing td->td_ucred, migration of suser() to using struct thread to derive the appropriate ucred, and allowing struct thread to be passed down to other code, such as network code where td is not currently available (and curproc is used). o Note: netncp and netsmb are not updated to reflect this change, as they are not currently KSE-adapted. Reviewed by: julian Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_divert.c4
-rw-r--r--sys/netinet/raw_ip.c2
-rw-r--r--sys/netinet/tcp_subr.c10
-rw-r--r--sys/netinet/tcp_timewait.c10
-rw-r--r--sys/netinet/udp_usrreq.c6
5 files changed, 17 insertions, 15 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index d63df09..56a602ac 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -46,6 +46,7 @@
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
+#include <sys/proc.h>
#include <sys/socket.h>
#include <sys/protosw.h>
#include <sys/socketvar.h>
@@ -485,7 +486,8 @@ div_pcblist(SYSCTL_HANDLER_ARGS)
s = splnet();
for (inp = LIST_FIRST(divcbinfo.listhead), i = 0; inp && i < n;
inp = LIST_NEXT(inp, inp_list)) {
- if (inp->inp_gencnt <= gencnt && !prison_xinpcb(req->p, inp))
+ if (inp->inp_gencnt <= gencnt && !prison_xinpcb(
+ req->td->td_proc, inp))
inp_list[i++] = inp;
}
splx(s);
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index b31be39..abc9f3b 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -627,7 +627,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->p->p_ucred,
+ if (cr_cansee(req->td->td_proc->p_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 99916c6..6a6c9f8 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -855,7 +855,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->p->p_ucred,
+ if (cr_cansee(req->td->td_proc->p_ucred,
inp->inp_socket->so_cred))
continue;
inp_list[i++] = inp;
@@ -913,7 +913,7 @@ tcp_getcred(SYSCTL_HANDLER_ARGS)
struct inpcb *inp;
int error, s;
- error = suser_xxx(0, req->p, PRISON_ROOT);
+ error = suser_xxx(0, req->td->td_proc, PRISON_ROOT);
if (error)
return (error);
error = SYSCTL_IN(req, addrs, sizeof(addrs));
@@ -926,7 +926,7 @@ tcp_getcred(SYSCTL_HANDLER_ARGS)
error = ENOENT;
goto out;
}
- error = cr_cansee(req->p->p_ucred, inp->inp_socket->so_cred);
+ error = cr_cansee(req->td->td_proc->p_ucred, inp->inp_socket->so_cred);
if (error)
goto out;
bzero(&xuc, sizeof(xuc));
@@ -953,7 +953,7 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS)
struct inpcb *inp;
int error, s, mapped = 0;
- error = suser_xxx(0, req->p, PRISON_ROOT);
+ error = suser_xxx(0, req->td->td_proc, PRISON_ROOT);
if (error)
return (error);
error = SYSCTL_IN(req, addrs, sizeof(addrs));
@@ -982,7 +982,7 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS)
error = ENOENT;
goto out;
}
- error = cr_cansee(req->p->p_ucred, inp->inp_socket->so_cred);
+ error = cr_cansee(req->td->td_proc->p_ucred, inp->inp_socket->so_cred);
if (error)
goto out;
bzero(&xuc, sizeof(xuc));
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index 99916c6..6a6c9f8 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -855,7 +855,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->p->p_ucred,
+ if (cr_cansee(req->td->td_proc->p_ucred,
inp->inp_socket->so_cred))
continue;
inp_list[i++] = inp;
@@ -913,7 +913,7 @@ tcp_getcred(SYSCTL_HANDLER_ARGS)
struct inpcb *inp;
int error, s;
- error = suser_xxx(0, req->p, PRISON_ROOT);
+ error = suser_xxx(0, req->td->td_proc, PRISON_ROOT);
if (error)
return (error);
error = SYSCTL_IN(req, addrs, sizeof(addrs));
@@ -926,7 +926,7 @@ tcp_getcred(SYSCTL_HANDLER_ARGS)
error = ENOENT;
goto out;
}
- error = cr_cansee(req->p->p_ucred, inp->inp_socket->so_cred);
+ error = cr_cansee(req->td->td_proc->p_ucred, inp->inp_socket->so_cred);
if (error)
goto out;
bzero(&xuc, sizeof(xuc));
@@ -953,7 +953,7 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS)
struct inpcb *inp;
int error, s, mapped = 0;
- error = suser_xxx(0, req->p, PRISON_ROOT);
+ error = suser_xxx(0, req->td->td_proc, PRISON_ROOT);
if (error)
return (error);
error = SYSCTL_IN(req, addrs, sizeof(addrs));
@@ -982,7 +982,7 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS)
error = ENOENT;
goto out;
}
- error = cr_cansee(req->p->p_ucred, inp->inp_socket->so_cred);
+ error = cr_cansee(req->td->td_proc->p_ucred, inp->inp_socket->so_cred);
if (error)
goto out;
bzero(&xuc, sizeof(xuc));
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 8090911..6eeb3a1 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->p->p_ucred,
+ if (cr_cansee(req->td->td_proc->p_ucred,
inp->inp_socket->so_cred))
continue;
inp_list[i++] = inp;
@@ -635,7 +635,7 @@ udp_getcred(SYSCTL_HANDLER_ARGS)
struct inpcb *inp;
int error, s;
- error = suser_xxx(0, req->p, PRISON_ROOT);
+ error = suser_xxx(0, req->td->td_proc, PRISON_ROOT);
if (error)
return (error);
error = SYSCTL_IN(req, addrs, sizeof(addrs));
@@ -648,7 +648,7 @@ udp_getcred(SYSCTL_HANDLER_ARGS)
error = ENOENT;
goto out;
}
- error = cr_cansee(req->p->p_ucred, inp->inp_socket->so_cred);
+ error = cr_cansee(req->td->td_proc->p_ucred, inp->inp_socket->so_cred);
if (error)
goto out;
bzero(&xuc, sizeof(xuc));
OpenPOWER on IntegriCloud