aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-iax2.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2007-02-21 06:48:28 +0000
committerAnders Broman <anders.broman@ericsson.com>2007-02-21 06:48:28 +0000
commitf34fa9c0ef73c23d0123329621804acda7df37e6 (patch)
tree08343665c6e37b958118151ae9d5bebecf391cbd /epan/dissectors/packet-iax2.c
parent86671a0de0e2b27f7b9c6f172c35e11259234ad8 (diff)
From Richard van der Hoff:
This patch makes the defragmentation code in the iax2 dissector handle pinfo->desegment_len=DESEGMENT_ONE_MORE_SEGMENT, in line with Ronnie's changes to the tcp dissector of 11 November. svn path=/trunk/; revision=20892
Diffstat (limited to 'epan/dissectors/packet-iax2.c')
-rw-r--r--epan/dissectors/packet-iax2.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c
index 926e110381..0bffa818e7 100644
--- a/epan/dissectors/packet-iax2.c
+++ b/epan/dissectors/packet-iax2.c
@@ -1789,12 +1789,17 @@ static void desegment_iax(tvbuff_t *tvb, packet_info *pinfo, proto_tree *iax2_tr
within that section, the higher-level dissector was unable to find any
pdus; if it's after that, it found one or more complete PDUs.
*/
- old_len = (gint32)(tvb_reported_length(next_tvb) - tvb_reported_length(tvb));
+ old_len = (gint32)(tvb_reported_length(next_tvb) - frag_len);
if( pinfo->desegment_len &&
pinfo->desegment_offset < old_len ) {
/* oops, it wasn't actually complete */
fragment_set_partial_reassembly(pinfo, fid, iax_call->fragment_table);
- dirdata->current_frag_minlen = fd_head->datalen + pinfo->desegment_len;
+ if(pinfo->desegment_len == DESEGMENT_ONE_MORE_SEGMENT) {
+ /* only one more byte should be enough for a retry */
+ dirdata->current_frag_minlen = fd_head->datalen + 1;
+ } else {
+ dirdata->current_frag_minlen = fd_head->datalen + pinfo->desegment_len;
+ }
} else {
/* we successfully dissected some data; create the proto tree items for
* the fragments, and flag any remaining data for desegmentation */
@@ -1847,7 +1852,14 @@ static void desegment_iax(tvbuff_t *tvb, packet_info *pinfo, proto_tree *iax2_tr
guint32 frag_len = tvb_reported_length_remaining(tvb,deseg_offset);
dirdata->current_frag_id = fid;
dirdata->current_frag_bytes = frag_len;
- dirdata->current_frag_minlen = frag_len + pinfo->desegment_len;
+
+ if(pinfo->desegment_len == DESEGMENT_ONE_MORE_SEGMENT) {
+ /* only one more byte should be enough for a retry */
+ dirdata->current_frag_minlen = frag_len + 1;
+ } else {
+ dirdata->current_frag_minlen = frag_len + pinfo->desegment_len;
+ }
+
fd_head = fragment_add(tvb, deseg_offset, pinfo, fid,
iax_call->fragment_table,
0, frag_len, TRUE );