|author||Guy Harris <firstname.lastname@example.org>||2016-01-25 12:20:08 -0800|
|committer||Guy Harris <email@example.com>||2016-01-25 20:20:58 +0000|
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 <firstname.lastname@example.org>
Diffstat (limited to 'wiretap')
1 files changed, 13 insertions, 0 deletions
diff --git a/wiretap/wtap.c b/wiretap/wtap.c
index 7cf87bf9cb..3dfb426297 100644
@@ -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))