aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-06-18 17:43:36 -0700
committerGuy Harris <gharris@sonic.net>2021-06-19 01:11:41 +0000
commit1afaa65fdd095889317d558cac8770b711ad00f9 (patch)
tree2cc16f052b687bc9f4e97e736878425556bb9862
parent755a4706444266c90d70a5efc2b6d68bca9cbc43 (diff)
pcap-common: set the time stamp precision correctly for LINKTYPE_ERF.
LINKTYPE_ERF pcap files are really ERF files inside a thin pcap wrapper (don't even ask what a pcapng file with some or all interfaces being LINKTYPE_ERF is...), so the time stamp comes from the ERF record, not from the pcap packet header or pcapng block header. The time stamp reslution for the record should reflect that, so set it to WTAP_TSPREC_NSEC (ERF time stamps are fractional-power-of-2, not fractional-power-of-10, so that's the best we can do). (cherry picked from commit 39315979c638b916d76a9dbf8c7ffb089721f01a)
-rw-r--r--wiretap/pcap-common.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/wiretap/pcap-common.c b/wiretap/pcap-common.c
index e7e367f343..5185498648 100644
--- a/wiretap/pcap-common.c
+++ b/wiretap/pcap-common.c
@@ -1437,6 +1437,15 @@ pcap_read_erf_pseudoheader(FILE_T fh, wtap_rec *rec,
rec->ts.nsecs -= 1000000000;
rec->ts.secs += 1;
}
+
+ /*
+ * This time stamp came from the ERF header, not from the
+ * pcap packet header or pcapng block header, so its
+ * precision is that of ERF time stamps, not the pcap
+ * file's time stamp or the pcapng interface's time
+ * stamp.
+ */
+ rec->tsprec = WTAP_TSPREC_NSEC;
}
/*