aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-01-25 12:20:08 -0800
committerGuy Harris <guy@alum.mit.edu>2016-01-25 20:20:58 +0000
commit623e5365e51723d880b5f4c010b2e745ad8da34d (patch)
treeaee20d16d17f4f0ef9d7d0ec186448f102bacbd4 /wiretap
parent6bd7e928c08167e8ee73b43a156c6fc0c20e744a (diff)
phdr->pkt_encap and phdr->pkt_tsprec need to be set for seek-read too.
We set them to the file's values in wtap_read(), but we weren't setting them in wtap_seek_read(); set them in both places. Change-Id: Id604b1c7d27d4cee6600249e9435c49d02f8dd61 Reviewed-on: https://code.wireshark.org/review/13531 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/wtap.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/wiretap/wtap.c b/wiretap/wtap.c
index 7cf87bf9cb..3dfb426297 100644
--- a/wiretap/wtap.c
+++ b/wiretap/wtap.c
@@ -1458,6 +1458,19 @@ gboolean
wtap_seek_read(wtap *wth, gint64 seek_off,
struct wtap_pkthdr *phdr, Buffer *buf, int *err, gchar **err_info)
{
+ /*
+ * Set the packet encapsulation to the file's encapsulation
+ * value; if that's not WTAP_ENCAP_PER_PACKET, it's the
+ * right answer (and means that the read routine for this
+ * capture file type doesn't have to set it), and if it
+ * *is* WTAP_ENCAP_PER_PACKET, the caller needs to set it
+ * anyway.
+ *
+ * Do the same for the packet time stamp resolution.
+ */
+ phdr->pkt_encap = wth->file_encap;
+ phdr->pkt_tsprec = wth->file_tsprec;
+
if (!wth->subtype_seek_read(wth, seek_off, phdr, buf, err, err_info))
return FALSE;