From 68779f8b5efd844caa3e209348d6d3e5ffe2d818 Mon Sep 17 00:00:00 2001 From: rwatson Date: Wed, 25 Aug 2004 01:23:38 +0000 Subject: In nfs_timer(), pass curthread rather than &thread0 into the protocol send routine. In IPv6 UDP, the thread will be passed to suser(), which asserts that if a thread is used for a super user check, it be curthread. Many of these protocol entry points probably need to accept credentials instead of threads. MT5 candidate. Noticed/tested by: kuriyama --- sys/nfsclient/nfs_socket.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sys/nfsclient/nfs_socket.c') diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c index e24b318..094a2e1 100644 --- a/sys/nfsclient/nfs_socket.c +++ b/sys/nfsclient/nfs_socket.c @@ -1139,11 +1139,9 @@ nfs_timer(void *arg) struct nfsmount *nmp; int timeo; int s, error; - struct thread *td; struct timeval now; getmicrouptime(&now); - td = &thread0; /* XXX for credentials, may break if sleep */ s = splnet(); TAILQ_FOREACH(rep, &nfs_reqq, r_chain) { nmp = rep->r_nmp; @@ -1206,10 +1204,10 @@ nfs_timer(void *arg) (m = m_copym(rep->r_mreq, 0, M_COPYALL, M_DONTWAIT))){ if ((nmp->nm_flag & NFSMNT_NOCONN) == 0) error = (*so->so_proto->pr_usrreqs->pru_send) - (so, 0, m, NULL, NULL, td); + (so, 0, m, NULL, NULL, curthread); else error = (*so->so_proto->pr_usrreqs->pru_send) - (so, 0, m, nmp->nm_nam, NULL, td); + (so, 0, m, nmp->nm_nam, NULL, curthread); if (error) { if (NFSIGNORE_SOERROR(nmp->nm_soflags, error)) so->so_error = 0; -- cgit v1.1