diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2012-09-18 17:26:00 +0000 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2012-09-18 17:26:00 +0000 |
commit | cb5b9158409509f50f1ed6fa3a0d77d3dbe220ef (patch) | |
tree | 050ae47539f55e936a670ab0a233ea0963b153aa /epan/dissectors/packet-mac-lte.c | |
parent | c7fa2f0b6f8937799f97982e60a6260112bf5e3f (diff) |
Fix dissection of Scheduling Information MAC Control Element when it is the only LCID in the MCH PDU
svn path=/trunk/; revision=44973
Diffstat (limited to 'epan/dissectors/packet-mac-lte.c')
-rw-r--r-- | epan/dissectors/packet-mac-lte.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c index c968996efb..0424695a87 100644 --- a/epan/dissectors/packet-mac-lte.c +++ b/epan/dissectors/packet-mac-lte.c @@ -3731,7 +3731,7 @@ static void dissect_mch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pro guint8 lcids[MAX_HEADERS_IN_PDU]; gint16 pdu_lengths[MAX_HEADERS_IN_PDU]; - proto_item *pdu_header_ti; + proto_item *pdu_header_ti, *sched_info_ti = NULL; proto_tree *pdu_header_tree; gboolean have_seen_data_header = FALSE; @@ -3797,6 +3797,9 @@ static void dissect_mch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pro lcids[number_of_headers] = first_byte & 0x1f; lcid_ti = proto_tree_add_item(pdu_subheader_tree, hf_mac_lte_mch_lcid, tvb, offset, 1, ENC_BIG_ENDIAN); + if (lcids[number_of_headers] == MCH_SCHEDULING_INFO_LCID) { + sched_info_ti = lcid_ti; + } write_pdu_label_and_info(pdu_ti, NULL, pinfo, "(%s", val_to_str_const(lcids[number_of_headers], @@ -3875,10 +3878,6 @@ static void dissect_mch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pro tvb, offset*8 + 1, 7, &length, ENC_BIG_ENDIAN); offset++; } - if ((lcids[number_of_headers] == MCH_SCHEDULING_INFO_LCID) && (length & 0x01)) { - expert_add_info_format(pinfo, lcid_ti, PI_MALFORMED, PI_WARN, - "MCH Scheduling Information MAC Control Element should have an even size"); - } pdu_lengths[number_of_headers] = (gint16)length; } else { @@ -3988,6 +3987,15 @@ static void dissect_mch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pro proto_item *mch_sched_info_ti, *ti; proto_tree *mch_sched_info_tree; + if (pdu_lengths[n] == -1) { + /* Control Element size is the remaining PDU */ + pdu_lengths[n] = (gint16)tvb_length_remaining(tvb, curr_offset); + } + if (pdu_lengths[n] & 0x01) { + expert_add_info_format(pinfo, sched_info_ti, PI_MALFORMED, PI_WARN, + "MCH Scheduling Information MAC Control Element should have an even size"); + } + mch_sched_info_ti = proto_tree_add_string_format(tree, hf_mac_lte_control_mch_scheduling_info, tvb, curr_offset, pdu_lengths[n], |