X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/abc8c2d61c65757011d9d32abb01cd1e51232f3a..e69972a8ef1ddbf73924e42f76f53a1f9d0aab0a:/print-nfs.c diff --git a/print-nfs.c b/print-nfs.c index a7218f25..c90eadbd 100644 --- a/print-nfs.c +++ b/print-nfs.c @@ -198,7 +198,7 @@ static const struct tok sunrpc_str[] = { }; static void -print_nfsaddr(netdissect_options *ndo, +nfsaddr_print(netdissect_options *ndo, const u_char *bp, const char *s, const char *d) { const struct ip *ip; @@ -291,7 +291,6 @@ parse_sattr3(netdissect_options *ndo, sa3->sa_atimetype = GET_BE_U_4(dp); dp++; if (sa3->sa_atimetype == NFSV3SATTRTIME_TOCLIENT) { - ND_TCHECK_4(dp + 1); sa3->sa_atime.nfsv3_sec = GET_BE_U_4(dp); dp++; sa3->sa_atime.nfsv3_nsec = GET_BE_U_4(dp); @@ -301,7 +300,6 @@ parse_sattr3(netdissect_options *ndo, sa3->sa_mtimetype = GET_BE_U_4(dp); dp++; if (sa3->sa_mtimetype == NFSV3SATTRTIME_TOCLIENT) { - ND_TCHECK_4(dp + 1); sa3->sa_mtime.nfsv3_sec = GET_BE_U_4(dp); dp++; sa3->sa_mtime.nfsv3_nsec = GET_BE_U_4(dp); @@ -309,8 +307,6 @@ parse_sattr3(netdissect_options *ndo, } return dp; -trunc: - return NULL; } static void @@ -344,7 +340,6 @@ nfsreply_print(netdissect_options *ndo, ndo->ndo_protocol = "nfs"; rp = (const struct sunrpc_msg *)bp; - ND_TCHECK_4(rp->rm_xid); if (!ndo->ndo_nflag) { strlcpy(srcid, "nfs", sizeof(srcid)); snprintf(dstid, sizeof(dstid), "%u", @@ -354,13 +349,9 @@ nfsreply_print(netdissect_options *ndo, snprintf(dstid, sizeof(dstid), "%u", GET_BE_U_4(rp->rm_xid)); } - print_nfsaddr(ndo, bp2, srcid, dstid); + nfsaddr_print(ndo, bp2, srcid, dstid); nfsreply_noaddr_print(ndo, bp, length, bp2); - return; - -trunc: - nd_print_trunc(ndo); } void @@ -915,7 +906,7 @@ nfs_printfh(netdissect_options *ndo, /* Print the undecoded handle */ ND_PRINT("%s", fsid.Opaque_Handle); else - ND_PRINT("%ld", (long) ino); + ND_PRINT("%u", ino); } /* @@ -1321,15 +1312,12 @@ parserddires(netdissect_options *ndo, if (ndo->ndo_qflag) return (1); - ND_TCHECK_4(dp + 2); ND_PRINT(" offset 0x%x size %u ", GET_BE_U_4(dp), GET_BE_U_4(dp + 1)); if (GET_BE_U_4(dp + 2) != 0) ND_PRINT(" eof"); return (1); -trunc: - return (0); } static const uint32_t *