On Mon, Sep 02, 2002 at 06:58:34PM +0900, YAMAMOTO Takashi wrote:
> i noticed that i missed ntohl in the code for uflag.
> please add it. thanks.

I.e., in the

        if (uflag) {
                int i;
                char const *sep = "";

                printf(" fh[");
                for (i=0; i<len; i++) {
                        (void)printf("%s%x", sep, dp[i]);
                        sep = ":";
                }
                printf("]");
                return;
        }

code?

If so, note that an NFS file handle is an opaque array of bytes, so
there's no guarantee that "ntohl()" will make the data look the way it's
"supposed to" - for example, most of the values in a file handle from a
Network Appliance file server are little-endian, not big-endian, as
we've used little-endian x86 and Alpha processors, and that'd probably
be the case for most UNIXes running on little-endian processors.

As such:

        1) the "dp" argument to "nfs_printfh()" should probably be a
           "const u_int8_t *" rather than a "const u_int32_t *";

        2) the "uflag" code should dump the bytes of the file handle,
           one byte at a time, rather than dumping a 32-bit word at a
           time (although it could put the separator out every 4 bytes).
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe

Reply via email to