From: Guy Harris Date: Wed, 25 Jun 2014 19:55:25 +0000 (-0700) Subject: Don't assume the NFS request is aligned on a 4-byte boundary. X-Git-Tag: tcpdump-4.6.0~5 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/f2b690e8b5f2cb9306ef77374346260ea0a7839c Don't assume the NFS request is aligned on a 4-byte boundary. The XID is a multi-byte field, and, if it's not aligned, it must be copied with UNALIGNED_MEMCPY(). This should fix GitHub issue #395. --- diff --git a/print-nfs.c b/print-nfs.c index cf3d71eb..dd2f7f12 100644 --- a/print-nfs.c +++ b/print-nfs.c @@ -905,7 +905,7 @@ xid_map_enter(netdissect_options *ndo, if (++xid_map_next >= XIDMAPSIZE) xid_map_next = 0; - xmep->xid = rp->rm_xid; + UNALIGNED_MEMCPY(&xmep->xid, &rp->rm_xid, sizeof(xmep->xid)); if (ip) { xmep->ipver = 4; UNALIGNED_MEMCPY(&xmep->client, &ip->ip_src, sizeof(ip->ip_src));