Ethereal-dev: [Ethereal-dev] [patch] support for 0 length filehandles

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Mike Frisch <mfrisch@xxxxxxxxxx>
Date: Fri, 14 Feb 2003 12:12:31 -0500
Kind of a misleading description, but essentially this patch adds
support for 0-length filehandles (as used in WebNFS's LOOKUP operation,
for example).
Index: packet-nfs.c
===================================================================
RCS file: /cvsroot/ethereal/packet-nfs.c,v
retrieving revision 1.84
diff -u -r1.84 packet-nfs.c
--- packet-nfs.c	2 Dec 2002 23:43:28 -0000	1.84
+++ packet-nfs.c	14 Feb 2003 17:10:34 -0000
@@ -2780,9 +2780,17 @@
 
 	proto_tree_add_uint(ftree, hf_nfs_fh_length, tvb, offset+0, 4,
 			fh3_len);
-	dissect_fhandle_data(tvb, offset+4, pinfo, ftree, fh3_len, FALSE);
 
-	offset += 4 + fh3_len_full;
+	/* Handle WebNFS requests where filehandle may be 0 length */
+	if (fh3_len > 0)
+	{
+		dissect_fhandle_data(tvb, offset+4, pinfo, ftree, fh3_len, FALSE);
+
+		offset += fh3_len_full;
+	}
+
+	offset += 4;
+
 	return offset;
 }