MPLS: fix Downstream Detailed Mapping TLV label stack dissection

The label stack is its own TLV, which adheres to the same format as
others, with a tag and length (obviously). The length to be used for
this TLV is not the remaining length of this packet, but its own length.

Bug: 16273
Change-Id: I469b55c5d78d1899d87030f3c0a15fd1afdf3f85
Reviewed-on: https://code.wireshark.org/review/35436
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Jaap Keuter 2019-12-14 09:49:20 +01:00 committed by Anders Broman
parent 625b71bb30
commit 6d7e98dd2b
1 changed files with 4 additions and 3 deletions

View File

@ -1408,7 +1408,7 @@ dissect_mpls_echo_tlv_dd_map(tvbuff_t *tvb, packet_info *pinfo, guint offset, pr
tlv_dd_map_tree = proto_tree_add_subtree(tree, tvb, offset - 4, subtlv_length + 4,
ett_mpls_echo_tlv_dd_map, NULL, "Label stack sub-TLV");
while (rem >= 4) {
while (subtlv_length >= 4) {
if (tree) {
decode_mpls_label(tvb, offset, &label, &tc, &s_bit, &proto);
@ -1421,8 +1421,9 @@ dissect_mpls_echo_tlv_dd_map(tvbuff_t *tvb, packet_info *pinfo, guint offset, pr
proto_tree_add_item(tlv_ddstlv_map_tree, hf_mpls_echo_tlv_ddstlv_map_mp_proto,
tvb, offset + 3, 1, ENC_BIG_ENDIAN);
}
rem -= 4;
offset += 4;
subtlv_length -= 4;
rem -= 4;
offset += 4;
idx++;
}
break;