Ethereal-dev: Re: [Ethereal-dev] LDP common hello param fixes

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

From: Guy Harris <guy@xxxxxxxxxx>
Date: Fri, 15 Mar 2002 18:09:39 -0800
On Fri, Mar 15, 2002 at 09:00:48PM -0500, Aamer Akhter wrote:
> Please find attached fixes for decoding the LDP common hello parameters. 
> The values were not being passed to the proto_tree_* functions.

The patch is partially incorrect.

    proto_tree_add_item(val_tree, hf_ldp_tlv_val_hold, tvb, offset, 2, FALSE);

is a correct call.  The call the patch changes it to:

    proto_tree_add_item(val_tree, hf_ldp_tlv_val_hold, tvb, offset, 2, tvb_get_ntohs(tvb,offset));

is an incorrect call.  The last argument to "proto_tree_add_item()" is a
Boolean indicating whether the value "proto_tree_add_item()" should
fetch from the tvbuff is (if byte order matters) to be treated as
big-endian or little-endian; it is not the value for the item.

The other two changes are correct, but a better change is to change
"proto_tree_add_boolean()" to "proto_tree_add_item()".  I've checked in
that change.