]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Another case where UNALIGNED_MEMCPY() is probably necessary.
authorGuy Harris <[email protected]>
Sat, 18 Jan 2014 20:09:45 +0000 (12:09 -0800)
committerGuy Harris <[email protected]>
Sat, 18 Jan 2014 20:09:45 +0000 (12:09 -0800)
It was necessary in other cases where we copied IP addresses from the IP
header, so it's probably necessary here as well.

print-nfs.c

index 50183916d294f95b763ba7d38f1d4519b33f90bf..4ec55e8c513c28fb0144eacfdb54691ff6a04bb4 100644 (file)
@@ -994,14 +994,14 @@ xid_map_enter(const struct sunrpc_msg *rp, const u_char *bp)
        xmep->xid = rp->rm_xid;
        if (ip) {
                xmep->ipver = 4;
-               memcpy(&xmep->client, &ip->ip_src, sizeof(ip->ip_src));
-               memcpy(&xmep->server, &ip->ip_dst, sizeof(ip->ip_dst));
+               UNALIGNED_MEMCPY(&xmep->client, &ip->ip_src, sizeof(ip->ip_src));
+               UNALIGNED_MEMCPY(&xmep->server, &ip->ip_dst, sizeof(ip->ip_dst));
        }
 #ifdef INET6
        else if (ip6) {
                xmep->ipver = 6;
-               memcpy(&xmep->client, &ip6->ip6_src, sizeof(ip6->ip6_src));
-               memcpy(&xmep->server, &ip6->ip6_dst, sizeof(ip6->ip6_dst));
+               UNALIGNED_MEMCPY(&xmep->client, &ip6->ip6_src, sizeof(ip6->ip6_src));
+               UNALIGNED_MEMCPY(&xmep->server, &ip6->ip6_dst, sizeof(ip6->ip6_dst));
        }
 #endif
        xmep->proc = EXTRACT_32BITS(&rp->rm_call.cb_proc);