Date: Fri, 9 Jan 2009 23:58:00 +0000 (UTC) From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r186986 - head/sys/net Message-ID: <200901092358.n09Nw0Ar072761@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bz Date: Fri Jan 9 23:57:59 2009 New Revision: 186986 URL: http://svn.freebsd.org/changeset/base/186986 Log: 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 Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Fri Jan 9 23:54:15 2009 (r186985) +++ head/sys/net/rtsock.c Fri Jan 9 23:57:59 2009 (r186986) @@ -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 * 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901092358.n09Nw0Ar072761>