From Harald Welte:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 4 Feb 2012 15:44:10 +0000 (15:44 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 4 Feb 2012 15:44:10 +0000 (15:44 +0000)
lapdm dissector tries to defragment segment of different streams.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6659

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40842 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-gsmtap.c
epan/dissectors/packet-lapdm.c

index 6cc9ba1d49fd9c9497b061def657e6bfdea8b10c..a75810d8e7646344e557d7e69aec6f225d9509a6 100644 (file)
@@ -332,15 +332,17 @@ dissect_gsmtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        proto_item *ti;
        proto_tree *gsmtap_tree = NULL;
        tvbuff_t *payload_tvb, *l1h_tvb = NULL;
-       guint8 hdr_len, type, sub_type;
+       guint8 hdr_len, type, sub_type, timeslot, subslot;
        guint16 arfcn;
 
        len = tvb_length(tvb);
 
        hdr_len = tvb_get_guint8(tvb, offset + 1) <<2;
        type = tvb_get_guint8(tvb, offset + 2);
-       sub_type = tvb_get_guint8(tvb, offset + 12);
+       timeslot = tvb_get_guint8(tvb, offset + 3);
        arfcn = tvb_get_ntohs(tvb, offset + 4);
+       sub_type = tvb_get_guint8(tvb, offset + 12);
+       subslot = tvb_get_guint8(tvb, offset + 14);
 
        /* In case of a SACCH, there is a two-byte L1 header in front
         * of the packet (see TS 04.04) */
@@ -384,6 +386,10 @@ dissect_gsmtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                pinfo->p2p_dir = P2P_DIR_RECV;
        }
 
+       /* Try to build an identifier of different 'streams' */
+       /* (AFCN _cant_ be used because of hopping */
+       pinfo->circuit_id = (timeslot << 3) | subslot;
+
        if (tree) {
                guint8 channel;
                const char *channel_str;
index 29cad2948049e28c1b1af2182833261d6ebe3bdd..e114f152b5bd134323ffa13c4029cb9ce405a4a3 100644 (file)
@@ -289,15 +289,20 @@ dissect_lapdm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     {
             fragment_data *fd_m = NULL;
             tvbuff_t *reassembled = NULL;
+            guint32 fragment_id;
             gboolean save_fragmented = pinfo->fragmented;
 
             pinfo->fragmented = m;
+
+            /* Rely on caller to provide a way to group fragments */
+            fragment_id = (pinfo->circuit_id << 4) | (sapi << 1) | pinfo->p2p_dir;
+
             /* This doesn't seem the best way of doing it as doesn't
                take N(S) into account, but N(S) isn't always 0 for
                the first fragment!
              */
             fd_m = fragment_add_seq_next (payload, 0, pinfo,
-                                0, /* guint32 ID for fragments belonging together */
+                                fragment_id, /* guint32 ID for fragments belonging together */
                                 lapdm_fragment_table, /* list of message fragments */
                                 lapdm_reassembled_table, /* list of reassembled messages */
                                 /*n_s guint32 fragment sequence number */