aboutsummaryrefslogtreecommitdiffstats
path: root/rawshark.c
diff options
context:
space:
mode:
authorSake Blok <sake@euronet.nl>2008-03-21 06:11:45 +0000
committerSake Blok <sake@euronet.nl>2008-03-21 06:11:45 +0000
commitf17067c174ac795d9f8b902e659b2edaa287ef79 (patch)
treebb9a18d1c3137c418a29252193f98824c7d0e67e /rawshark.c
parente4f89044bda90bb778fe40a0d40be467798dcfb5 (diff)
Make tshark and rawshark behave similar to wireshark when "frame.time_delta_displayed" is
used within a display filter. (the usefullness of "frame.time_delta_displayed" in a display filter is very limited since it bites it's own tail. Still, wireshark and tshark should at least show the same behaviour) svn path=/trunk/; revision=24708
Diffstat (limited to 'rawshark.c')
-rw-r--r--rawshark.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/rawshark.c b/rawshark.c
index 4c61779e2f..0768243527 100644
--- a/rawshark.c
+++ b/rawshark.c
@@ -1039,12 +1039,16 @@ fill_in_fdata(frame_data *fdata, capture_file *cf,
cf->elapsed_time = fdata->rel_ts;
}
+ /* If we don't have the time stamp of the previous displayed packet,
+ it's because this is the first packet that's being displayed. Save the time
+ stamp of this packet as the time stamp of the previous displayed
+ packet. */
+ if (nstime_is_unset(&prev_dis_ts))
+ prev_dis_ts = fdata->abs_ts;
+
/* Get the time elapsed between the previous displayed packet and
this packet. */
- if (nstime_is_unset(&prev_dis_ts))
- nstime_set_zero(&fdata->del_dis_ts);
- else
- nstime_delta(&fdata->del_dis_ts, &fdata->abs_ts, &prev_dis_ts);
+ nstime_delta(&fdata->del_dis_ts, &fdata->abs_ts, &prev_dis_ts);
/* Get the time elapsed between the previous captured packet and
this packet. */