aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-pdcp-lte.c
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2018-03-01 01:10:45 +0000
committerAnders Broman <a.broman58@gmail.com>2018-03-02 05:24:06 +0000
commit6e09b8b3913df943377b7710bbd0598f296be8fd (patch)
tree6efc19cc08d8d62214f1611df8ba2786ef918505 /epan/dissectors/packet-pdcp-lte.c
parent1a0987904fa571dc5abce03726e4ca3e17793574 (diff)
PDCP: speed up dissection of status PDU.
N.B. In normal traffic status PDUs do not appear very often, but if the config of RLC/PDCP are wrong, every PDU can appear to be a status PDU and it can take a long time to print out the list of missing sequence numbers. Change-Id: I9514b505639fa58d86bf5ebb3fb2bcf1f8e65aa8 Reviewed-on: https://code.wireshark.org/review/26197 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-pdcp-lte.c')
-rw-r--r--epan/dissectors/packet-pdcp-lte.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/epan/dissectors/packet-pdcp-lte.c b/epan/dissectors/packet-pdcp-lte.c
index ca4b1a3dff..ec1f843372 100644
--- a/epan/dissectors/packet-pdcp-lte.c
+++ b/epan/dissectors/packet-pdcp-lte.c
@@ -1997,7 +1997,6 @@ static int dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
switch (control_pdu_type) {
case 0: /* PDCP status report */
{
- guint8 bits;
guint32 fms;
guint32 modulo;
guint not_received = 0;
@@ -2069,21 +2068,28 @@ static int dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset, -1, ENC_NA);
bitmap_tree = proto_item_add_subtree(bitmap_ti, ett_pdcp_report_bitmap);
- buff = (gchar *)wmem_alloc(wmem_packet_scope(), BUFF_SIZE);
- len = tvb_reported_length_remaining(tvb, offset);
- bit_offset = offset<<3;
+ buff = (gchar *)wmem_alloc(wmem_packet_scope(), BUFF_SIZE);
+ len = tvb_reported_length_remaining(tvb, offset);
+ bit_offset = offset<<3;
+
/* For each byte... */
for (i=0; i<len; i++) {
- bits = tvb_get_bits8(tvb, bit_offset, 8);
+ guint8 bits = tvb_get_bits8(tvb, bit_offset, 8);
for (l=0, j=0; l<8; l++) {
if ((bits << l) & 0x80) {
- j += g_snprintf(&buff[j], BUFF_SIZE-j, "%6u,", (unsigned)(sn+(8*i)+l)%modulo);
+ if (bitmap_tree) {
+ j += g_snprintf(&buff[j], BUFF_SIZE-j, "%6u,", (unsigned)(sn+(8*i)+l)%modulo);
+ }
} else {
- j += g_snprintf(&buff[j], BUFF_SIZE-j, " ,");
+ if (bitmap_tree) {
+ j += (guint)g_strlcpy(&buff[j], " ,", BUFF_SIZE-j);
+ }
not_received++;
}
}
- proto_tree_add_uint_format(bitmap_tree, hf_pdcp_lte_bitmap_byte, tvb, bit_offset/8, 1, bits, "%s", buff);
+ if (bitmap_tree) {
+ proto_tree_add_uint_format(bitmap_tree, hf_pdcp_lte_bitmap_byte, tvb, bit_offset/8, 1, bits, "%s", buff);
+ }
bit_offset += 8;
}
}