#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-nfs.c,v 1.86 2000-10-03 02:54:59 itojun Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-nfs.c,v 1.91 2002-04-24 06:27:06 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
struct rtentry;
#include <netinet/in.h>
-#ifdef INET6
-#include <netinet/ip6.h>
-#endif
#include <rpc/rpc.h>
#include "nfsfh.h"
#include "ip.h"
+#ifdef INET6
+#include "ip6.h"
+#endif
static void nfs_printfh(const u_int32_t *, const u_int);
static void xid_map_enter(const struct rpc_msg *, const u_char *);
{
my_fsid fsid;
ino_t ino;
- char *sfsname = NULL;
+ const char *sfsname = NULL;
+ char *spacep;
- Parse_fh((caddr_t*)dp, len, &fsid, &ino, NULL, &sfsname, 0);
+ Parse_fh((const u_char *)dp, len, &fsid, &ino, NULL, &sfsname, 0);
if (sfsname) {
/* file system ID is ASCII, not numeric, for this server OS */
strncpy(temp, sfsname, NFSX_V3FHMAX);
temp[sizeof(temp) - 1] = '\0';
/* Remove trailing spaces */
- sfsname = strchr(temp, ' ');
- if (sfsname)
- *sfsname = 0;
+ spacep = strchr(temp, ' ');
+ if (spacep)
+ *spacep = '\0';
(void)printf(" fh %s/", temp);
} else {
int er;
dp = parsestatus(dp, &er);
- if (dp == 0 || er)
+ if (dp == NULL || er)
return (0);
if (qflag)
return (1);
case NFSPROC_ACCESS:
printf(" access");
- dp = parserep(rp, length);
+ if (!(dp = parserep(rp, length)))
+ break;
if (!(dp = parsestatus(dp, &er)))
break;
if (vflag)