diff options
-rw-r--r-- | cfile.c | 1 | ||||
-rw-r--r-- | cfile.h | 1 | ||||
-rw-r--r-- | file.c | 11 |
3 files changed, 12 insertions, 1 deletions
@@ -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; } @@ -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 */ @@ -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(); |