summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSake Blok <sake@euronet.nl>2008-09-30 15:45:20 +0000
committerSake Blok <sake@euronet.nl>2008-09-30 15:45:20 +0000
commit2ce22e6bca4a7e90ca201016ed8d408373ac2a60 (patch)
treec05822615d1ccfc02e84affb8965374ea33198d6
parentaa30dcd1293b7eb218140724a377092afa35ffb3 (diff)
downloadwireshark-2ce22e6bca4a7e90ca201016ed8d408373ac2a60.tar.gz
From jmmikkel@mit.edu (Bug 2895):
We might receive new packets while redissecting and don't want to dissect those before the packet-list is fully rebuilt. svn path=/trunk/; revision=26309
-rw-r--r--cfile.c1
-rw-r--r--cfile.h1
-rw-r--r--file.c11
3 files changed, 12 insertions, 1 deletions
diff --git a/cfile.c b/cfile.c
index 8ad55160f7..aa218e607b 100644
--- a/cfile.c
+++ b/cfile.c
@@ -55,4 +55,5 @@ init_cap_file(capture_file *cf)
cf->snap = WTAP_MAX_PACKET_SIZE;
cf->count = 0;
cf->pstats = NULL;
+ cf->redissecting = FALSE;
}
diff --git a/cfile.h b/cfile.h
index a5b154158d..138609dcde 100644
--- a/cfile.h
+++ b/cfile.h
@@ -61,6 +61,7 @@ typedef struct _capture_file {
wtap *wth; /* Wiretap session */
dfilter_t *rfcode; /* Compiled read (display) filter program */
gchar *dfilter; /* Display filter string */
+ gboolean redissecting; /* TRUE if currently redissecting (cf_redissect_packets) */
/* search */
gchar *sfilter; /* Search filter string */
gboolean sbackward; /* TRUE if search is backward, FALSE if forward */
diff --git a/file.c b/file.c
index 1ecbae107e..f4415cdd0a 100644
--- a/file.c
+++ b/file.c
@@ -1122,7 +1122,9 @@ read_packet(capture_file *cf, dfilter_t *dfcode, gint64 offset)
cf->count++;
cf->f_datalen = offset + phdr->caplen;
fdata->num = cf->count;
- row = add_packet_to_packet_list(fdata, cf, dfcode, pseudo_header, buf, TRUE);
+ if (!cf->redissecting) {
+ row = add_packet_to_packet_list(fdata, cf, dfcode, pseudo_header, buf, TRUE);
+ }
} else {
/* XXX - if we didn't have read filters, or if we could avoid
allocating the "frame_data" structure until we knew whether
@@ -1515,6 +1517,10 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item,
which might cause the state information to be constructed differently
by that dissector. */
+ /* We might receive new packets while redissecting, and we don't
+ want to dissect those before their time. */
+ cf->redissecting = TRUE;
+
/* Initialize all data structures used for dissection. */
init_dissection();
}
@@ -1661,6 +1667,9 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item,
prev_frame = fdata;
}
+ /* We are done redissecting the packet list. */
+ cf->redissecting = FALSE;
+
/* Re-sort the list using the previously selected order */
packet_list_set_sort_column();