diff options
Diffstat (limited to 'sys/rpc/clnt_vc.c')
-rw-r--r-- | sys/rpc/clnt_vc.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c index 9699a8d..9f36bba 100644 --- a/sys/rpc/clnt_vc.c +++ b/sys/rpc/clnt_vc.c @@ -220,9 +220,7 @@ clnt_vc_create( } } - CURVNET_SET(so->so_vnet); if (!__rpc_socket2sockinfo(so, &si)) { - CURVNET_RESTORE(); goto err; } @@ -245,7 +243,6 @@ clnt_vc_create( sopt.sopt_valsize = sizeof(one); sosetopt(so, &sopt); } - CURVNET_RESTORE(); ct->ct_closeit = FALSE; @@ -916,7 +913,7 @@ clnt_vc_soupcall(struct socket *so, void *arg, int waitflag) mtx_unlock(&ct->ct_lock); break; } - bcopy(mtod(m, uint32_t *), &header, sizeof(uint32_t)); + m_copydata(m, 0, sizeof(uint32_t), (char *)&header); header = ntohl(header); ct->ct_record = NULL; ct->ct_record_resid = header & 0x7fffffff; @@ -975,14 +972,11 @@ clnt_vc_soupcall(struct socket *so, void *arg, int waitflag) * The XID is in the first uint32_t of * the reply. */ - if (ct->ct_record->m_len < sizeof(xid)) - ct->ct_record = - m_pullup(ct->ct_record, - sizeof(xid)); - if (!ct->ct_record) + if (ct->ct_record->m_len < sizeof(xid) && + m_length(ct->ct_record, NULL) < sizeof(xid)) break; - bcopy(mtod(ct->ct_record, uint32_t *), - &xid, sizeof(uint32_t)); + m_copydata(ct->ct_record, 0, sizeof(xid), + (char *)&xid); xid = ntohl(xid); mtx_lock(&ct->ct_lock); |