]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Don't assume the NFS request is aligned on a 4-byte boundary.
authorGuy Harris <[email protected]>
Wed, 25 Jun 2014 19:55:25 +0000 (12:55 -0700)
committerGuy Harris <[email protected]>
Wed, 25 Jun 2014 19:55:25 +0000 (12:55 -0700)
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.

print-nfs.c

index cf3d71ebed90bb55e0f7d6b19e04162652f26443..dd2f7f12fd2b8033b3e62c29a729a880aff67ac2 100644 (file)
@@ -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));