Ethereal-dev: Re: [Ethereal-dev] [PATCH] packet-ppp.c highlights wrong number of octets

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

From: Guy Harris <gharris@xxxxxxxxx>
Date: Sat, 30 Oct 2004 01:48:06 -0700
Charles Levert wrote:

   if(tree) {
-    ti = proto_tree_add_item(tree, proto_ppp, tvb, 0, -1, FALSE);
+    ti = proto_tree_add_item(tree, proto_ppp, tvb, 0, 0, FALSE);
     fh_tree = proto_item_add_subtree(ti, ett_ppp);
   }

Setting the length to "all the way to the end" arranges that, if an exception is thrown before the length is explicitly set, it covers the entire packet, so that it covers all of the header that's there (because not all of the header is there).

I made the other call to create that item also set the length to "all the way to the end", and passed the length of the stuff prior to the protocol field as an explicit argument to "dissect_ppp_common()", and had it use that argument rather than the length of the item.