summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2009-01-09 23:57:59 +0000
committerbz <bz@FreeBSD.org>2009-01-09 23:57:59 +0000
commit8ef504d98df9e2f7590d0472259b1551eb4f1cb2 (patch)
tree7e4b3afbeb039989a0401308af4c23c89b66c930
parent34a5fb9b43ef5ffaf1843a7958a18b2af0f4e242 (diff)
downloadFreeBSD-src-8ef504d98df9e2f7590d0472259b1551eb4f1cb2.zip
FreeBSD-src-8ef504d98df9e2f7590d0472259b1551eb4f1cb2.tar.gz
Rather than using the cred from curthread, take it from the thread
referenced in the sysctl req argument. Reviewed by: rwatson MFC after: 2 weeks
-rw-r--r--sys/net/rtsock.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 76953f4..45e3c92 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1326,8 +1326,8 @@ sysctl_iflist(int af, struct walkarg *w)
while ((ifa = TAILQ_NEXT(ifa, ifa_link)) != NULL) {
if (af && af != ifa->ifa_addr->sa_family)
continue;
- if (jailed(curthread->td_ucred) &&
- !prison_if(curthread->td_ucred, ifa->ifa_addr))
+ if (jailed(w->w_req->td->td_ucred) &&
+ !prison_if(w->w_req->td->td_ucred, ifa->ifa_addr))
continue;
info.rti_info[RTAX_IFA] = ifa->ifa_addr;
info.rti_info[RTAX_NETMASK] = ifa->ifa_netmask;
@@ -1375,8 +1375,8 @@ sysctl_ifmalist(int af, struct walkarg *w)
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (af && af != ifma->ifma_addr->sa_family)
continue;
- if (jailed(curthread->td_ucred) &&
- !prison_if(curthread->td_ucred, ifma->ifma_addr))
+ if (jailed(w->w_req->td->td_ucred) &&
+ !prison_if(w->w_req->td->td_ucred, ifma->ifma_addr))
continue;
info.rti_info[RTAX_IFA] = ifma->ifma_addr;
info.rti_info[RTAX_GATEWAY] =
@@ -1457,7 +1457,7 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS)
* take care of routing entries
*/
for (error = 0; error == 0 && i <= lim; i++)
- if ((rnh = V_rt_tables[curthread->td_proc->p_fibnum][i]) != NULL) {
+ if ((rnh = V_rt_tables[req->td->td_proc->p_fibnum][i]) != NULL) {
RADIX_NODE_HEAD_LOCK(rnh);
error = rnh->rnh_walktree(rnh,
sysctl_dumpentry, &w);
OpenPOWER on IntegriCloud