summaryrefslogtreecommitdiffstats
path: root/sys/rpc/clnt_dg.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/rpc/clnt_dg.c')
-rw-r--r--sys/rpc/clnt_dg.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/rpc/clnt_dg.c b/sys/rpc/clnt_dg.c
index a01f598..d35a6a9 100644
--- a/sys/rpc/clnt_dg.c
+++ b/sys/rpc/clnt_dg.c
@@ -1089,15 +1089,14 @@ clnt_dg_soupcall(struct socket *so, void *arg, int waitflag)
/*
* The XID is in the first uint32_t of the reply.
*/
- if (m->m_len < sizeof(xid))
- m = m_pullup(m, sizeof(xid));
- if (!m)
+ if (m->m_len < sizeof(xid) && m_length(m, NULL) < sizeof(xid))
/*
* Should never happen.
*/
continue;
- xid = ntohl(*mtod(m, uint32_t *));
+ m_copydata(m, 0, sizeof(xid), (char *)&xid);
+ xid = ntohl(xid);
/*
* Attempt to match this reply with a pending request.
OpenPOWER on IntegriCloud