packet-hsrp.c: Fix the display length of some tlv-blocks

Change-Id: I4e4dc682153e226ad4989f5b6b39a11b13abf763
Reviewed-on: https://code.wireshark.org/review/28566
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
This commit is contained in:
Joerg Mayer 2018-07-02 09:47:41 +02:00 committed by Jörg Mayer
parent 8998c91b32
commit 18c6408f87
1 changed files with 6 additions and 3 deletions

View File

@ -482,7 +482,7 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
proto_tree *group_state_tlv;
if (tree) {
ti = proto_tree_add_uint_format_value(hsrp_tree, hf_hsrp2_group_state_tlv, tvb, offset, 2, type,
ti = proto_tree_add_uint_format_value(hsrp_tree, hf_hsrp2_group_state_tlv, tvb, offset, 2+len, type,
"Type=%d Len=%d", type, len);
}
offset+=2;
@ -551,7 +551,7 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
if (tree) {
proto_tree *interface_state_tlv;
ti = proto_tree_add_uint_format_value(hsrp_tree, hf_hsrp2_interface_state_tlv, tvb, offset, 1, type,
"Type=%d Len=%d", type, len);
"Type=%d Len=%d", type, 2+len);
offset+=2;
/* Making Interface State TLV subtree */
@ -563,11 +563,14 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
} else if (type == 3 && len == 8) {
/* Text Authentication TLV */
/* FIXME: Is the length of the authentication string really restricted to 8 bytes
* or is it maybe padded to multiples of 4 or 8 bytes?
*/
if (tree) {
proto_tree *text_auth_tlv;
gchar auth_buf[8 + 1];
ti = proto_tree_add_uint_format_value(hsrp_tree, hf_hsrp2_text_auth_tlv, tvb, offset, 1, type,
ti = proto_tree_add_uint_format_value(hsrp_tree, hf_hsrp2_text_auth_tlv, tvb, offset, 2+len, type,
"Type=%d Len=%d", type, len);
offset+=2;