aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2011-06-06 16:07:09 +0000
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2011-06-06 16:07:09 +0000
commitb3cbce492a5d5dc77df8784c1bd43195f67f6b6a (patch)
tree9f4ba13c3d6894c8dc439472c38111676c1fe266
parentd6d24d6d1849dde6af07b64656ead1d456afd25c (diff)
Warn if there are > 2 padding subheaders at the beginning of a frame.
svn path=/trunk/; revision=37570
-rw-r--r--epan/dissectors/packet-mac-lte.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c
index 4c0f911b30..835125e0a1 100644
--- a/epan/dissectors/packet-mac-lte.c
+++ b/epan/dissectors/packet-mac-lte.c
@@ -2272,6 +2272,7 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
proto_tree *pdu_header_tree;
gboolean have_seen_data_header = FALSE;
+ guint8 number_of_padding_subheaders = 0;
gboolean have_seen_non_padding_control = FALSE;
gboolean have_seen_bsr = FALSE;
gboolean expecting_body_data = FALSE;
@@ -2410,7 +2411,7 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
if ((direction == DIRECTION_UPLINK) && is_bsr_lcid(lcids[number_of_headers])) {
if (have_seen_bsr) {
expert_add_info_format(pinfo, lcid_ti, PI_MALFORMED, PI_ERROR,
- "There shouldn't be > 1 BSR in a frame");
+ "There shouldn't be > 1 BSR in a frame");
return;
}
have_seen_bsr = TRUE;
@@ -2419,10 +2420,18 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
/* Should not see padding after non-padding control... */
if ((lcids[number_of_headers] > 10) &&
(lcids[number_of_headers] == PADDING_LCID) &&
- extension &&
- have_seen_non_padding_control) {
+ extension)
+ {
+ number_of_padding_subheaders++;
+ if (number_of_padding_subheaders > 2) {
+ expert_add_info_format(pinfo, lcid_ti, PI_MALFORMED, PI_WARN,
+ "Should not see more than 2 padding subheaders in one frame");
+ }
+
+ if (have_seen_non_padding_control) {
expert_add_info_format(pinfo, lcid_ti, PI_MALFORMED, PI_ERROR,
- "Padding should come before other control subheaders!");
+ "Padding should come before other control subheaders!");
+ }
}
/* Remember that we've seen non-padding control */