HomeFreeBSD

Copy all bits of a file handle in case there is padding in the structure.

Description

Copy all bits of a file handle in case there is padding in the structure.

At least on x86, fhandle_t is a packed structure, so I believe an
assignment will copy all the bits. However, for some current/future
architectures, there might be padding in the structure that doesn't get
copied via an assignment.
Since NFS assumes a file handle is an opaque blob of bits that can be
compared via memcmp()/bcmp(), all the bits including any padding must be
copied.
This patch replaces the assignments with a call to a byte copy function.
Spotted during code inspection.

Details

Provenance
rmacklemAuthored on
Parents
rS337356: loader: bd_open() should cleanup from disk_open() error
Branches
Unknown
Tags
Unknown