diff options
author | Joerg Mayer <jmayer@loplof.de> | 2018-07-02 09:47:41 +0200 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2018-07-03 14:42:19 +0000 |
commit | 18c6408f874d3a933b8a1646821bf9733b2de7c6 (patch) | |
tree | 78be3e009056d2bf8644dda6733e7ab7c9189bb2 /epan/dissectors/packet-hsrp.c | |
parent | 8998c91b326a821e8982211c65ddc39ec72df2fc (diff) |
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>
Diffstat (limited to 'epan/dissectors/packet-hsrp.c')
-rw-r--r-- | epan/dissectors/packet-hsrp.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/epan/dissectors/packet-hsrp.c b/epan/dissectors/packet-hsrp.c index 051788e140..89141bffd0 100644 --- a/epan/dissectors/packet-hsrp.c +++ b/epan/dissectors/packet-hsrp.c @@ -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; |