diff options
Diffstat (limited to 'contrib/tcpdump/print-nfs.c')
-rw-r--r-- | contrib/tcpdump/print-nfs.c | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/contrib/tcpdump/print-nfs.c b/contrib/tcpdump/print-nfs.c index 743339e..c66c97e 100644 --- a/contrib/tcpdump/print-nfs.c +++ b/contrib/tcpdump/print-nfs.c @@ -23,7 +23,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-nfs.c,v 1.89 2001/07/08 08:01:43 itojun Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-nfs.c,v 1.89.4.2 2002/06/01 23:51:14 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -34,9 +34,6 @@ static const char rcsid[] = #include <sys/time.h> #include <sys/socket.h> -struct mbuf; -struct rtentry; - #include <netinet/in.h> #include <rpc/rpc.h> @@ -718,10 +715,16 @@ nfsreq_print(register const u_char *bp, u_int length, case NFSPROC_FSINFO: printf(" fsinfo"); + if ((dp = parsereq(rp, length)) != NULL && + parsefh(dp, v3) != NULL) + return; break; case NFSPROC_PATHCONF: printf(" pathconf"); + if ((dp = parsereq(rp, length)) != NULL && + parsefh(dp, v3) != NULL) + return; break; case NFSPROC_COMMIT: @@ -1029,7 +1032,6 @@ parsestatus(const u_int32_t *dp, int *er) printf(" ERROR: %s", tok2str(status2str, "unk %d", errnum)); nfserr = 1; - return (NULL); } return (dp + 1); trunc: @@ -1111,8 +1113,10 @@ parseattrstat(const u_int32_t *dp, int verbose, int v3) int er; dp = parsestatus(dp, &er); - if (dp == NULL || er) + if (dp == NULL) return (0); + if (er) + return (1); return (parsefattr(dp, verbose, v3) != NULL); } @@ -1122,8 +1126,10 @@ parsediropres(const u_int32_t *dp) { int er; - if (!(dp = parsestatus(dp, &er)) || er) + if (!(dp = parsestatus(dp, &er))) return (0); + if (er) + return (1); dp = parsefh(dp, 0); if (dp == NULL) @@ -1138,8 +1144,10 @@ parselinkres(const u_int32_t *dp, int v3) int er; dp = parsestatus(dp, &er); - if (dp == NULL || er) + if (dp == NULL) return(0); + if (er) + return(1); if (v3 && !(dp = parse_post_op_attr(dp, vflag))) return (0); putchar(' '); @@ -1153,8 +1161,10 @@ parsestatfs(const u_int32_t *dp, int v3) int er; dp = parsestatus(dp, &er); - if (dp == NULL || (!v3 && er)) + if (dp == NULL) return (0); + if (!v3 && er) + return (1); if (qflag) return(1); @@ -1166,7 +1176,7 @@ parsestatfs(const u_int32_t *dp, int v3) return (0); } - TCHECK2(dp, (v3 ? NFSX_V3STATFS : NFSX_V2STATFS)); + TCHECK2(*dp, (v3 ? NFSX_V3STATFS : NFSX_V2STATFS)); sfsp = (const struct nfs_statfs *)dp; @@ -1207,8 +1217,10 @@ parserddires(const u_int32_t *dp) int er; dp = parsestatus(dp, &er); - if (dp == NULL || er) + if (dp == NULL) return (0); + if (er) + return (1); if (qflag) return (1); @@ -1244,7 +1256,7 @@ parse_pre_op_attr(const u_int32_t *dp, int verbose) if (!ntohl(dp[0])) return (dp + 1); dp++; - TCHECK2(dp, 24); + TCHECK2(*dp, 24); if (verbose > 1) { return parse_wcc_attr(dp); } else { @@ -1381,9 +1393,9 @@ parsefsinfo(const u_int32_t *dp) (u_int32_t) ntohl(sfp->fs_timedelta.nfsv3_sec), (u_int32_t) ntohl(sfp->fs_timedelta.nfsv3_nsec)); } - return (0); -trunc: return (1); +trunc: + return (0); } static int @@ -1411,9 +1423,9 @@ parsepathconf(const u_int32_t *dp) ntohl(spp->pc_chownrestricted) ? "chownres" : "", ntohl(spp->pc_caseinsensitive) ? "igncase" : "", ntohl(spp->pc_casepreserving) ? "keepcase" : ""); - return (0); -trunc: return (1); +trunc: + return (0); } static void |