aboutsummaryrefslogtreecommitdiffstats
path: root/ui/cli
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-06-21 01:19:47 -0400
committerAnders Broman <a.broman58@gmail.com>2016-06-21 07:17:33 +0000
commite6481a9e882ed9b34abd2d898c9a12f3ca56d91e (patch)
treea27f8db5d854700835f9123d50db2ae34286c7d8 /ui/cli
parentf76af2ed92fdbc6bab5380db6e104c184b62fb4b (diff)
Check for negative nanoseconds in io,stat tap.
Seconds were already being checked for negative values, but if there is only a fraction of a second, the negative check wasn't being done, which led to bad results. Bug: 9014 Change-Id: I820e0a4b1384330acebf4a632a04f7840db2288b Reviewed-on: https://code.wireshark.org/review/16046 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/cli')
-rw-r--r--ui/cli/tap-iostat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/cli/tap-iostat.c b/ui/cli/tap-iostat.c
index d481e1e898..522a307efe 100644
--- a/ui/cli/tap-iostat.c
+++ b/ui/cli/tap-iostat.c
@@ -107,7 +107,7 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
/* If this frame's relative time is negative, set its relative time to last_relative_time
rather than disincluding it from the calculations. */
- if (pinfo->rel_ts.secs >= 0) {
+ if ((pinfo->rel_ts.secs >= 0) && (pinfo->rel_ts.nsecs >= 0)) {
relative_time = ((guint64)pinfo->rel_ts.secs * G_GUINT64_CONSTANT(1000000)) +
((guint64)((pinfo->rel_ts.nsecs+500)/1000));
last_relative_time = relative_time;