aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2013-07-14 14:42:05 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2013-07-14 14:42:05 +0000
commitc766e78cfa1527ed242580b808635b0b5966cf3e (patch)
tree7a4318d94e33c292936eb8cffca5e5ff31e73c55 /epan/dissectors
parentd924325d37c8724a447f76f8789063580bd86876 (diff)
Rewrite reassemble API to use TVBs instead of raw data.
(it seems to be working for TCP ^^) svn path=/trunk/; revision=50580
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-ber.c2
-rw-r--r--epan/dissectors/packet-dcerpc.c8
-rw-r--r--epan/dissectors/packet-dcp-etsi.c2
-rw-r--r--epan/dissectors/packet-eap.c4
-rw-r--r--epan/dissectors/packet-fc.c4
-rw-r--r--epan/dissectors/packet-gssapi.c4
-rw-r--r--epan/dissectors/packet-iax2.c2
-rw-r--r--epan/dissectors/packet-mime-encap.c6
-rw-r--r--epan/dissectors/packet-mp2t.c2
-rw-r--r--epan/dissectors/packet-mq.c2
-rw-r--r--epan/dissectors/packet-ncp2222.inc3
-rw-r--r--epan/dissectors/packet-ndps.c3
-rw-r--r--epan/dissectors/packet-netbios.c3
-rw-r--r--epan/dissectors/packet-ppi.c7
-rw-r--r--epan/dissectors/packet-q931.c2
-rw-r--r--epan/dissectors/packet-rpc.c3
-rw-r--r--epan/dissectors/packet-smb-pipe.c6
-rw-r--r--epan/dissectors/packet-smb.c9
-rw-r--r--epan/dissectors/packet-sna.c3
-rw-r--r--epan/dissectors/packet-ssl.c4
-rw-r--r--epan/dissectors/packet-t38.c21
-rw-r--r--epan/dissectors/packet-tcp.c6
-rw-r--r--epan/dissectors/packet-x25.c4
23 files changed, 44 insertions, 66 deletions
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index b2898e26c4..f6b5f11413 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -1423,7 +1423,7 @@ reassemble_octet_string(asn1_ctx_t *actx, proto_tree *tree, gint hf_id, tvbuff_t
proto_tree *next_tree;
proto_item *frag_tree_item;
- reassembled_tvb = tvb_new_child_real_data(next_tvb, fd_head->data, fd_head->len, fd_head->len);
+ reassembled_tvb = tvb_new_chain(next_tvb, fd_head->tvb_data);
actx->created_item = proto_tree_add_item(tree, hf_id, reassembled_tvb, 0, -1, ENC_BIG_ENDIAN);
next_tree = proto_item_add_subtree (actx->created_item, ett_ber_reassembled_octet_string);
diff --git a/epan/dissectors/packet-dcerpc.c b/epan/dissectors/packet-dcerpc.c
index 24106f709d..f7f5cf192e 100644
--- a/epan/dissectors/packet-dcerpc.c
+++ b/epan/dissectors/packet-dcerpc.c
@@ -3434,8 +3434,8 @@ end_cn_stub:
tvbuff_t *next_tvb;
proto_item *frag_tree_item;
- next_tvb = tvb_new_child_real_data((decrypted_tvb)?decrypted_tvb:payload_tvb,
- fd_head->data, fd_head->len, fd_head->len);
+ next_tvb = tvb_new_chain((decrypted_tvb)?decrypted_tvb:payload_tvb,
+ fd_head->tvb_data);
add_new_data_source(pinfo, next_tvb, "Reassembled DCE/RPC");
show_fragment_tree(fd_head, &dcerpc_frag_items,
@@ -4069,7 +4069,7 @@ dissect_dcerpc_cn_fault(tvbuff_t *tvb, gint offset, packet_info *pinfo,
tvbuff_t *next_tvb;
proto_item *frag_tree_item;
- next_tvb = tvb_new_child_real_data(tvb, fd_head->data, fd_head->len, fd_head->len);
+ next_tvb = tvb_new_chain(tvb, fd_head->tvb_data);
add_new_data_source(pinfo, next_tvb, "Reassembled DCE/RPC");
show_fragment_tree(fd_head, &dcerpc_frag_items,
dcerpc_tree, pinfo, next_tvb, &frag_tree_item);
@@ -5063,7 +5063,7 @@ dissect_dcerpc_dg_stub(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* We completed reassembly... */
if (pinfo->fd->num == fd_head->reassembled_in) {
/* ...and this is the reassembled RPC PDU */
- next_tvb = tvb_new_child_real_data(tvb, fd_head->data, fd_head->len, fd_head->len);
+ next_tvb = tvb_new_chain(tvb, fd_head->tvb_data);
add_new_data_source(pinfo, next_tvb, "Reassembled DCE/RPC");
show_fragment_seq_tree(fd_head, &dcerpc_frag_items,
tree, pinfo, next_tvb, &pi);
diff --git a/epan/dissectors/packet-dcp-etsi.c b/epan/dissectors/packet-dcp-etsi.c
index a344c5a6e4..1a35ef58c9 100644
--- a/epan/dissectors/packet-dcp-etsi.c
+++ b/epan/dissectors/packet-dcp-etsi.c
@@ -293,7 +293,7 @@ dissect_pft_fec_detailed(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
/* make a list of the findex (offset) numbers of the fragments we have */
fd = fragment_get(&dcp_reassembly_table, pinfo, seq, NULL);
for (fd_head = fd; fd_head != NULL && fragments < fcount; fd_head = fd_head->next) {
- if(fd_head->data) {
+ if(fd_head->tvb_data) {
got[fragments++] = fd_head->offset; /* this is the findex of the fragment */
}
}
diff --git a/epan/dissectors/packet-eap.c b/epan/dissectors/packet-eap.c
index 09f6975461..2261b26117 100644
--- a/epan/dissectors/packet-eap.c
+++ b/epan/dissectors/packet-eap.c
@@ -1016,9 +1016,7 @@ dissect_eap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
proto_item *frag_tree_item;
- next_tvb = tvb_new_child_real_data(tvb, fd_head->data,
- fd_head->len,
- fd_head->len);
+ next_tvb = tvb_new_chain(tvb, fd_head->tvb_data);
add_new_data_source(pinfo, next_tvb, "Reassembled EAP-TLS");
show_fragment_seq_tree(fd_head, &eap_tls_frag_items,
diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c
index 828d739201..7cde39d6d4 100644
--- a/epan/dissectors/packet-fc.c
+++ b/epan/dissectors/packet-fc.c
@@ -1171,9 +1171,7 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
!is_lastframe_inseq);
if (fcfrag_head) {
- next_tvb = tvb_new_child_real_data(tvb, fcfrag_head->data,
- fcfrag_head->datalen,
- fcfrag_head->datalen);
+ next_tvb = tvb_new_chain(tvb, fcfrag_head->tvb_data);
/* Add the defragmented data to the data source list. */
add_new_data_source(pinfo, next_tvb, "Reassembled FC");
diff --git a/epan/dissectors/packet-gssapi.c b/epan/dissectors/packet-gssapi.c
index d42fd3ab62..7e2fb4f4ad 100644
--- a/epan/dissectors/packet-gssapi.c
+++ b/epan/dissectors/packet-gssapi.c
@@ -271,7 +271,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
gss_info->do_reassembly=FALSE;
fi->reassembled_in=pinfo->fd->num;
- gss_tvb=tvb_new_child_real_data(tvb, fd_head->data, fd_head->datalen, fd_head->datalen);
+ gss_tvb=tvb_new_chain(tvb, fd_head->tvb_data);
add_new_data_source(pinfo, gss_tvb, "Reassembled GSSAPI");
}
/* We have seen this packet before.
@@ -286,7 +286,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if(fd_head && (fd_head->flags&FD_DEFRAGMENTED)){
if(pinfo->fd->num==fi->reassembled_in){
proto_item *frag_tree_item;
- gss_tvb=tvb_new_child_real_data(tvb, fd_head->data, fd_head->datalen, fd_head->datalen);
+ gss_tvb=tvb_new_chain(tvb, fd_head->tvb_data);
add_new_data_source(pinfo, gss_tvb, "Reassembled GSSAPI");
show_fragment_tree(fd_head, &gssapi_frag_items, tree, pinfo, tvb, &frag_tree_item);
} else {
diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c
index 89827b765b..51b94feee5 100644
--- a/epan/dissectors/packet-iax2.c
+++ b/epan/dissectors/packet-iax2.c
@@ -2202,7 +2202,7 @@ static void desegment_iax(tvbuff_t *tvb, packet_info *pinfo, proto_tree *iax2_tr
if (fd_head && (pinfo->fd->num == fd_head->reassembled_in)) {
gint32 old_len;
- tvbuff_t *next_tvb = tvb_new_child_real_data(tvb, fd_head->data, fd_head->datalen, fd_head->datalen);
+ tvbuff_t *next_tvb = tvb_new_chain(tvb, fd_head->tvb_data);
add_new_data_source(pinfo, next_tvb, "Reassembled IAX2");
process_iax_pdu(next_tvb, pinfo, tree, video, iax_packet);
diff --git a/epan/dissectors/packet-mime-encap.c b/epan/dissectors/packet-mime-encap.c
index 46000e440f..4ea57a55cb 100644
--- a/epan/dissectors/packet-mime-encap.c
+++ b/epan/dissectors/packet-mime-encap.c
@@ -89,12 +89,8 @@ dissect_mime_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* on it, which would append to whole_tvb chain and would be freed only in mime_encap_init.
*
* So we create some tvb which pass all calls to whole_tvb, but chain with tvb (which is freed in dissection cleanup)
- *
- * BIG FAT NOTE: YOU NORMALLY DON'T WANT TO DO IT, SO DON'T COPY THIS CODE!!!!!111
*/
- tvbuff_t *tmp_tvb = tvb_new_temporary(whole_tvb);
-
- tvb_add_to_chain(tvb, tmp_tvb);
+ tvbuff_t *tmp_tvb = tvb_new_chain(tvb, whole_tvb);
proto_item_append_text(item, " (Final)");
diff --git a/epan/dissectors/packet-mp2t.c b/epan/dissectors/packet-mp2t.c
index 7dc0dc519d..3be3c959e6 100644
--- a/epan/dissectors/packet-mp2t.c
+++ b/epan/dissectors/packet-mp2t.c
@@ -486,7 +486,7 @@ mp2t_get_packet_length(tvbuff_t *tvb, guint offset, packet_info *pinfo,
} else {
/* Create a composite tvb out of the two */
- frag_tvb = tvb_new_real_data(frag->data, frag->len, frag->len);
+ frag_tvb = tvb_new_proxy(frag->tvb_data);
len_tvb = tvb_new_composite();
tvb_composite_append(len_tvb, frag_tvb);
diff --git a/epan/dissectors/packet-mq.c b/epan/dissectors/packet-mq.c
index 2067312f39..0e6bebefb8 100644
--- a/epan/dissectors/packet-mq.c
+++ b/epan/dissectors/packet-mq.c
@@ -2397,7 +2397,7 @@ reassemble_mq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (fd_head->next != NULL)
{
/* 2 or more fragments */
- next_tvb = tvb_new_child_real_data(tvb, fd_head->data, fd_head->len, fd_head->len);
+ next_tvb = tvb_new_chain(tvb, fd_head->tvb_data);
add_new_data_source(pinfo, next_tvb, "Reassembled MQ");
}
else
diff --git a/epan/dissectors/packet-ncp2222.inc b/epan/dissectors/packet-ncp2222.inc
index 0396134023..478dd8e491 100644
--- a/epan/dissectors/packet-ncp2222.inc
+++ b/epan/dissectors/packet-ncp2222.inc
@@ -7271,8 +7271,7 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint32 nw_connection, guint8 sequ
/* Is this the last fragment? nds_frag will indicate */
if (fd_head->next != NULL && !request_value->nds_frag)
{
- frag_tvb = tvb_new_child_real_data(tvb, fd_head->data,
- fd_head->len, fd_head->len);
+ frag_tvb = tvb_new_chain(tvb, fd_head->tvb_data);
add_new_data_source(pinfo,
frag_tvb,
"Reassembled NDS");
diff --git a/epan/dissectors/packet-ndps.c b/epan/dissectors/packet-ndps.c
index 7c404bf7ae..8dc1f83855 100644
--- a/epan/dissectors/packet-ndps.c
+++ b/epan/dissectors/packet-ndps.c
@@ -4401,8 +4401,7 @@ ndps_defrag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *frag_tree_item;
- next_tvb = tvb_new_child_real_data(tvb, fd_head->data,
- fd_head->len, fd_head->len);
+ next_tvb = tvb_new_chain(tvb, fd_head->tvb_data);
add_new_data_source(pinfo,
next_tvb,
"Reassembled NDPS");
diff --git a/epan/dissectors/packet-netbios.c b/epan/dissectors/packet-netbios.c
index e774e7c91f..b3bdbeaca0 100644
--- a/epan/dissectors/packet-netbios.c
+++ b/epan/dissectors/packet-netbios.c
@@ -1170,8 +1170,7 @@ dissect_netbios(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
len, command == NB_DATA_FIRST_MIDDLE);
if (fd_head != NULL) {
if (fd_head->next != NULL) {
- next_tvb = tvb_new_child_real_data(tvb, fd_head->data,
- fd_head->len, fd_head->len);
+ next_tvb = tvb_new_chain(tvb, fd_head->tvb_data);
add_new_data_source(pinfo,
next_tvb,
"Reassembled NetBIOS");
diff --git a/epan/dissectors/packet-ppi.c b/epan/dissectors/packet-ppi.c
index 7faf954efc..31bac84b1b 100644
--- a/epan/dissectors/packet-ppi.c
+++ b/epan/dissectors/packet-ppi.c
@@ -936,7 +936,7 @@ dissect_ppi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
seg_tree = proto_item_add_subtree(ti, ett_ampdu_segments);
while (ft_fdh) {
- if (ft_fdh->data && ft_fdh->len) {
+ if (ft_fdh->tvb_data && ft_fdh->len) {
last_frame = ft_fdh->frame;
if (!first_mpdu)
proto_item_append_text(ti, ",");
@@ -966,12 +966,11 @@ dissect_ppi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
while (fd_head) {
- if (fd_head->data && fd_head->len) {
+ if (fd_head->tvb_data && fd_head->len) {
mpdu_count++;
mpdu_str = ep_strdup_printf("MPDU #%d", mpdu_count);
- next_tvb = tvb_new_child_real_data(tvb, fd_head->data,
- fd_head->len, fd_head->len);
+ next_tvb = tvb_new_chain(tvb, fd_head->tvb_data);
add_new_data_source(pinfo, next_tvb, mpdu_str);
if (agg_tree) {
diff --git a/epan/dissectors/packet-q931.c b/epan/dissectors/packet-q931.c
index 6389c367a0..37b1154317 100644
--- a/epan/dissectors/packet-q931.c
+++ b/epan/dissectors/packet-q931.c
@@ -2676,7 +2676,7 @@ dissect_q931_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (fd_head) {
if (pinfo->fd->num == fd_head->reassembled_in) { /* last fragment */
if (fd_head->next != NULL) { /* 2 or more segments */
- next_tvb = tvb_new_child_real_data(tvb, fd_head->data, fd_head->len, fd_head->len);
+ next_tvb = tvb_new_chain(tvb, fd_head->tvb_data);
add_new_data_source(pinfo, next_tvb, "Reassembled Q.931 IEs");
/* Show all fragments. */
if (tree) {
diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c
index 7a3e333b77..ecdef223b6 100644
--- a/epan/dissectors/packet-rpc.c
+++ b/epan/dissectors/packet-rpc.c
@@ -3430,8 +3430,7 @@ dissect_rpc_fragment(tvbuff_t *tvb, int offset, packet_info *pinfo,
* Create a new TVB structure for
* defragmented data.
*/
- rec_tvb = tvb_new_child_real_data(tvb, ipfd_head->data,
- ipfd_head->datalen, ipfd_head->datalen);
+ rec_tvb = tvb_new_chain(tvb, ipfd_head->tvb_data);
/*
* Add defragmented data to the data source list.
diff --git a/epan/dissectors/packet-smb-pipe.c b/epan/dissectors/packet-smb-pipe.c
index faeade271a..f9fffcac88 100644
--- a/epan/dissectors/packet-smb-pipe.c
+++ b/epan/dissectors/packet-smb-pipe.c
@@ -3381,8 +3381,7 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree
/* if we completed reassembly */
if(fd_head){
- new_tvb = tvb_new_child_real_data(d_tvb, fd_head->data,
- fd_head->datalen, fd_head->datalen);
+ new_tvb = tvb_new_chain(d_tvb, fd_head->tvb_data);
add_new_data_source(pinfo, new_tvb,
"DCERPC over SMB");
pinfo->fragmented=FALSE;
@@ -3431,8 +3430,7 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree
/* display the reassembled pdu */
- new_tvb = tvb_new_child_real_data(d_tvb, fd_head->data,
- fd_head->datalen, fd_head->datalen);
+ new_tvb = tvb_new_chain(d_tvb, fd_head->tvb_data);
add_new_data_source(pinfo, new_tvb,
"DCERPC over SMB");
pinfo->fragmented=FALSE;
diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c
index 6b9b6cc8ab..6850b620dd 100644
--- a/epan/dissectors/packet-smb.c
+++ b/epan/dissectors/packet-smb.c
@@ -9147,8 +9147,7 @@ dissect_nt_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (r_fd) {
proto_item *frag_tree_item;
- pd_tvb = tvb_new_child_real_data(tvb, r_fd->data, r_fd->datalen,
- r_fd->datalen);
+ pd_tvb = tvb_new_chain(tvb, r_fd->tvb_data);
add_new_data_source(pinfo, pd_tvb, "Reassembled SMB");
show_fragment_tree(r_fd, &smb_frag_items, tree, pinfo, pd_tvb, &frag_tree_item);
@@ -9698,8 +9697,7 @@ dissect_nt_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
if (r_fd) {
proto_item *frag_tree_item;
- pd_tvb = tvb_new_child_real_data(tvb, r_fd->data, r_fd->datalen,
- r_fd->datalen);
+ pd_tvb = tvb_new_chain(tvb, r_fd->tvb_data);
add_new_data_source(pinfo, pd_tvb, "Reassembled SMB");
show_fragment_tree(r_fd, &smb_frag_items, tree, pinfo, pd_tvb, &frag_tree_item);
@@ -16691,8 +16689,7 @@ dissect_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if (r_fd) {
proto_item *frag_tree_item;
- pd_tvb = tvb_new_child_real_data(tvb, r_fd->data, r_fd->datalen,
- r_fd->datalen);
+ pd_tvb = tvb_new_chain(tvb, r_fd->tvb_data);
add_new_data_source(pinfo, pd_tvb, "Reassembled SMB");
show_fragment_tree(r_fd, &smb_frag_items, tree, pinfo, pd_tvb, &frag_tree_item);
}
diff --git a/epan/dissectors/packet-sna.c b/epan/dissectors/packet-sna.c
index f73fc48e5a..23cc6a52bb 100644
--- a/epan/dissectors/packet-sna.c
+++ b/epan/dissectors/packet-sna.c
@@ -1701,8 +1701,7 @@ defragment_by_sequence(packet_info *pinfo, tvbuff_t *tvb, int offset, int mpf,
if (fd_head != NULL) {
/* We have the complete reassembled payload. */
- rh_tvb = tvb_new_child_real_data(tvb, fd_head->data,
- fd_head->len, fd_head->len);
+ rh_tvb = tvb_new_chain(tvb, fd_head->tvb_data);
/* Add the defragmented data to the data
* source list. */
diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c
index 8f38d451b9..0418f398e3 100644
--- a/epan/dissectors/packet-ssl.c
+++ b/epan/dissectors/packet-ssl.c
@@ -1129,9 +1129,7 @@ again:
int old_len;
/* create a new TVB structure for desegmented data */
- next_tvb = tvb_new_child_real_data(tvb, ipfd_head->data,
- ipfd_head->datalen,
- ipfd_head->datalen);
+ next_tvb = tvb_new_chain(tvb, ipfd_head->tvb_data);
/* add desegmented data to the data source list */
add_new_data_source(pinfo, next_tvb, "Reassembled SSL");
diff --git a/epan/dissectors/packet-t38.c b/epan/dissectors/packet-t38.c
index 1259313480..63be9bee96 100644
--- a/epan/dissectors/packet-t38.c
+++ b/epan/dissectors/packet-t38.c
@@ -344,6 +344,7 @@ force_reassemble_seq(reassembly_table *table, packet_info *pinfo, guint32 id)
fragment_data *fd_i;
fragment_data *last_fd;
guint32 dfpos, size, packet_lost, burst_lost, seq_num;
+ char *data;
fd_head = fragment_get(table, pinfo, id, NULL);
@@ -386,7 +387,9 @@ force_reassemble_seq(reassembly_table *table, packet_info *pinfo, guint32 id)
}
last_fd=fd_i;
}
- fd_head->data = (char *)g_malloc(size);
+
+ data = g_malloc(size);
+ fd_head->tvb_data = tvb_new_real_data(data, size, size);
fd_head->len = size; /* record size for caller */
/* add all data fragments */
@@ -395,14 +398,14 @@ force_reassemble_seq(reassembly_table *table, packet_info *pinfo, guint32 id)
for (fd_i=fd_head->next;fd_i && fd_i->len + dfpos <= size;fd_i=fd_i->next) {
if (fd_i->len) {
if(!last_fd || last_fd->offset!=fd_i->offset){
- memcpy(fd_head->data+dfpos,fd_i->data,fd_i->len);
+ memcpy(data+dfpos,tvb_get_ptr(fd_i->tvb_data,0,fd_i->len),fd_i->len);
dfpos += fd_i->len;
} else {
/* duplicate/retransmission/overlap */
fd_i->flags |= FD_OVERLAP;
fd_head->flags |= FD_OVERLAP;
if( (last_fd->len!=fd_i->datalen)
- || memcmp(last_fd->data, fd_i->data, last_fd->len) ){
+ || tvb_memeql(last_fd->tvb_data, 0, tvb_get_ptr(fd_i->tvb_data, 0, last_fd->len), last_fd->len) ){
fd_i->flags |= FD_OVERLAPCONFLICT;
fd_head->flags |= FD_OVERLAPCONFLICT;
}
@@ -413,9 +416,9 @@ force_reassemble_seq(reassembly_table *table, packet_info *pinfo, guint32 id)
/* we have defragmented the pdu, now free all fragments*/
for (fd_i=fd_head->next;fd_i;fd_i=fd_i->next) {
- if(fd_i->data){
- g_free(fd_i->data);
- fd_i->data=NULL;
+ if(fd_i->tvb_data){
+ tvb_free(fd_i->tvb_data);
+ fd_i->tvb_data=NULL;
}
}
@@ -977,7 +980,7 @@ static int dissect_UDPTLPacket_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pr
/*--- End of included file: packet-t38-fn.c ---*/
-#line 391 "../../asn1/t38/packet-t38-template.c"
+#line 394 "../../asn1/t38/packet-t38-template.c"
/* initialize the tap t38_info and the conversation */
static void
@@ -1333,7 +1336,7 @@ proto_register_t38(void)
"OCTET_STRING", HFILL }},
/*--- End of included file: packet-t38-hfarr.c ---*/
-#line 670 "../../asn1/t38/packet-t38-template.c"
+#line 673 "../../asn1/t38/packet-t38-template.c"
{ &hf_t38_setup,
{ "Stream setup", "t38.setup", FT_STRING, BASE_NONE,
NULL, 0x0, "Stream setup, method and frame number", HFILL }},
@@ -1394,7 +1397,7 @@ proto_register_t38(void)
&ett_t38_T_fec_data,
/*--- End of included file: packet-t38-ettarr.c ---*/
-#line 717 "../../asn1/t38/packet-t38-template.c"
+#line 720 "../../asn1/t38/packet-t38-template.c"
&ett_t38_setup,
&ett_data_fragment,
&ett_data_fragments
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index 2f4b958641..74676a6918 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -1792,9 +1792,7 @@ again:
int old_len;
/* create a new TVB structure for desegmented data */
- next_tvb = tvb_new_child_real_data(tvb, ipfd_head->data,
- ipfd_head->datalen,
- ipfd_head->datalen);
+ next_tvb = tvb_new_chain(tvb, ipfd_head->tvb_data);
/* add desegmented data to the data source list */
add_new_data_source(pinfo, next_tvb, "Reassembled TCP");
@@ -4673,7 +4671,7 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* create a new TVB structure for desegmented data
* datalen-1 to strip the dummy FIN byte off
*/
- next_tvb = tvb_new_child_real_data(tvb, ipfd_head->data, ipfd_head->datalen, ipfd_head->datalen);
+ next_tvb = tvb_new_chain(tvb, ipfd_head->tvb_data);
/* add desegmented data to the data source list */
add_new_data_source(pinfo, next_tvb, "Reassembled TCP");
diff --git a/epan/dissectors/packet-x25.c b/epan/dissectors/packet-x25.c
index 5bf75062db..0060674bd7 100644
--- a/epan/dissectors/packet-x25.c
+++ b/epan/dissectors/packet-x25.c
@@ -1959,9 +1959,7 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_item *frag_tree_item;
/* This is the last packet */
- next_tvb = tvb_new_child_real_data(tvb, fd_head->data,
- fd_head->len,
- fd_head->len);
+ next_tvb = tvb_new_chain(tvb, fd_head->tvb_data);
add_new_data_source(pinfo, next_tvb, "Reassembled X.25");
if (x25_tree) {
show_fragment_seq_tree(fd_head,