aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/wimax
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2011-07-04 14:57:12 +0000
committerAnders Broman <anders.broman@ericsson.com>2011-07-04 14:57:12 +0000
commitd6fda1f1f5bb0d24c9268d00a22415e75dbc6644 (patch)
treeea17b03051f0dee7e50ccae7834dce04f10aa2ef /plugins/wimax
parent4257e61b6c8d496cb0f91a9f3ceaf5ddb551a065 (diff)
From Kluchnikov Ivan:
Wrong length of items in wimax Compressed DL-MAP and UL-MAP. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6067 svn path=/trunk/; revision=37890
Diffstat (limited to 'plugins/wimax')
-rw-r--r--plugins/wimax/msg_dlmap.c16
-rw-r--r--plugins/wimax/msg_ulmap.c4
2 files changed, 16 insertions, 4 deletions
diff --git a/plugins/wimax/msg_dlmap.c b/plugins/wimax/msg_dlmap.c
index c19bc362b3..f06d58f804 100644
--- a/plugins/wimax/msg_dlmap.c
+++ b/plugins/wimax/msg_dlmap.c
@@ -2092,6 +2092,7 @@ gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tre
/* if there is a compressed ul-map, also decode that and include in the length */
guint offset = 0;
proto_item *ti = NULL;
+ proto_item *ti_dlmap_ies = NULL;
proto_item *generic_item = NULL;
proto_tree *tree = NULL;
proto_tree *ie_tree = NULL;
@@ -2137,8 +2138,8 @@ gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tre
/* DL-MAP IEs */
length -= 15; /* remaining length in bytes (11 bytes above + CRC at end) */
if (dl_ie_count) {
- ti = proto_tree_add_text(tree, tvb, offset, length, "DL-MAP IEs (%d bytes)", length);
- ie_tree = proto_item_add_subtree(ti, ett_dlmap_ie);
+ ti_dlmap_ies = proto_tree_add_text(tree, tvb, offset, length, "DL-MAP IEs (%d bytes)", length);
+ ie_tree = proto_item_add_subtree(ti_dlmap_ies, ett_dlmap_ie);
length = BYTE_TO_NIB(mac_len - sizeof(mac_crc) - 1); /* convert length to nibbles */
@@ -2153,6 +2154,17 @@ gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tre
}
if (ulmap_appended) {
+ /* Replace the text of items to set the correct length in bytes.*/
+ proto_item_set_text(ti, "Compressed DL-MAP (%u bytes)", NIB_ADDR(nib));
+ proto_item_set_text(ti_dlmap_ies, "DL-MAP IEs (%u bytes)",NIB_ADDR(nib)- offset);
+
+ /* set the length of items */
+ proto_item_set_end(ti_dlmap_ies, tvb, NIB_ADDR(nib));
+ proto_item_set_end(ti, tvb, NIB_ADDR(nib));
+
+ /* update the info column */
+ col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Compressed UL-MAP");
+
/* subtract 8 from lennib (CRC) */
nib += wimax_decode_ulmapc(base_tree, bufptr, nib, lennib - 8, tvb);
}
diff --git a/plugins/wimax/msg_ulmap.c b/plugins/wimax/msg_ulmap.c
index cb5113967d..72b1442247 100644
--- a/plugins/wimax/msg_ulmap.c
+++ b/plugins/wimax/msg_ulmap.c
@@ -1960,7 +1960,7 @@ gint wimax_decode_ulmapc(proto_tree *base_tree, const guint8 *bufptr, gint offse
nib = offset;
/* display MAC UL-MAP */
- ti = proto_tree_add_protocol_format(base_tree, proto_mac_mgmt_msg_ulmap_decoder, tvb, NIBHI(offset,length), "Compressed UL-MAP");
+ ti = proto_tree_add_protocol_format(base_tree, proto_mac_mgmt_msg_ulmap_decoder, tvb, NIBHI(offset,length-offset), "Compressed UL-MAP (%u bytes)", NIB_ADDR(length-offset));
tree = proto_item_add_subtree(ti, ett_306);
/* Decode and display the UL-MAP */
@@ -1974,7 +1974,7 @@ gint wimax_decode_ulmapc(proto_tree *base_tree, const guint8 *bufptr, gint offse
proto_tree_add_uint(tree, hf_ulmap_ofdma_sym, tvb, NIBHI(nib,2), data); /* added 2005 */
nib += 2;
- ti = proto_tree_add_text(tree, tvb, NIBHI(nib,length-nib), "UL-MAP IEs");
+ ti = proto_tree_add_text(tree, tvb, NIBHI(nib,length-nib), "UL-MAP IEs (%u bytes)", NIB_ADDR(length-nib));
ie_tree = proto_item_add_subtree(ti, ett_306_ul);
while (nib < length-1) {
nib += dissect_ulmap_ie(ie_tree, bufptr, nib, length-nib, tvb);