diff options
author | Hadriel Kaplan <hadrielk@yahoo.com> | 2015-08-05 09:24:50 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-09-18 04:20:17 +0000 |
commit | 22bc307c8dc99c6c8e1664d1f8994863e459f884 (patch) | |
tree | 1ea225e859ec2c1b8bc6ecc47da87b963754a7e5 /epan/dissectors/packet-rtp.c | |
parent | f5bf04edb1ac0d8a21fa85bedf5fed9c35864560 (diff) |
RTP: handle payload reassembly for multiple fragments
If an RTP payload spans more than two packets, the dissector needs to
save the previous fragment info.
Bug: 11413
Change-Id: I62558f40136881d70bf2a9597eabd3697966ac4a
Reviewed-on: https://code.wireshark.org/review/9875
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-rtp.c')
-rw-r--r-- | epan/dissectors/packet-rtp.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c index 905fdbf79c..ca05a7cf5e 100644 --- a/epan/dissectors/packet-rtp.c +++ b/epan/dissectors/packet-rtp.c @@ -1608,27 +1608,25 @@ dissect_rtp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* * Check to see if there were any complete fragments within the chunk */ - if( pinfo->desegment_len && pinfo->desegment_offset == 0 ) + if( pinfo->desegment_len ) { + if (pinfo->desegment_offset == 0) { #ifdef DEBUG_FRAGMENTS - g_debug("\tNo complete pdus in payload" ); + g_debug("\tNo complete pdus in payload" ); #endif - /* Mark the fragments and not complete yet */ - fragment_set_partial_reassembly(&rtp_reassembly_table, - pinfo, fid, NULL); + /* Mark the fragments as not complete yet */ + fragment_set_partial_reassembly(&rtp_reassembly_table, + pinfo, fid, NULL); + + /* we must need another segment */ + msp->endseq = MIN(msp->endseq, seqno) + 1; - /* we must need another segment */ - msp->endseq = MIN(msp->endseq, seqno) + 1; - } - else - { - if(pinfo->desegment_len) - { - /* the higher-level dissector has asked for some more data - ie, - the end of this segment does not coincide with the end of a - higher-level PDU. */ - must_desegment = TRUE; } + + /* the higher-level dissector has asked for some more data - ie, + the end of this segment does not coincide with the end of a + higher-level PDU. */ + must_desegment = TRUE; } } @@ -1674,10 +1672,12 @@ dissect_rtp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, deseg_offset); #endif /* allocate a new msp for this pdu */ - msp = wmem_new(wmem_file_scope(), rtp_multisegment_pdu); - msp->startseq = seqno; - msp->endseq = seqno+1; - wmem_tree_insert32(finfo->multisegment_pdus, seqno, msp); + if (!PINFO_FD_VISITED(pinfo)) { + msp = wmem_new(wmem_file_scope(), rtp_multisegment_pdu); + msp->startseq = seqno; + msp->endseq = seqno+1; + wmem_tree_insert32(finfo->multisegment_pdus, seqno, msp); + } /* * Add the fragment to the fragment table @@ -1699,7 +1699,7 @@ dissect_rtp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g_debug("\tReassembled in %d", fd_head->reassembled_in); #endif } - else + else if (fd_head->reassembled_in == 0) { #ifdef DEBUG_FRAGMENTS g_debug("\tUnfinished fragment"); |