aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2005-06-30 02:31:15 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2005-06-30 02:31:15 +0000
commita60bb6ada973249b4f6b251bd3b6af5d97d3ff8d (patch)
tree87b9dd4bb6e06f72520b8848593d6f8eea471ad4 /wiretap
parent324bed302925041c4eaa27d908e45e63a269bd9c (diff)
make reading of observer files work again
for some reason we have forgotten to skip the initial (always 8?) bytes prior to the start of the frame. svn path=/trunk/; revision=14822
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/network_instruments.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/wiretap/network_instruments.c b/wiretap/network_instruments.c
index 4244ba0427..b5d7416e14 100644
--- a/wiretap/network_instruments.c
+++ b/wiretap/network_instruments.c
@@ -283,7 +283,7 @@ static gboolean observer_seek_read(wtap *wth, long seek_off,
int *err, gchar **err_info)
{
packet_entry_header packet_header;
-
+ long seek_increment;
int bytes_read;
if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1)
@@ -305,6 +305,16 @@ static gboolean observer_seek_read(wtap *wth, long seek_off,
return FALSE;
}
+
+ /* get the frame offset */
+ packet_header.offset_to_frame =
+ GUINT16_FROM_LE(packet_header.offset_to_frame);
+ seek_increment = packet_header.offset_to_frame - sizeof(packet_header);
+ if(seek_increment>0) {
+ if (file_seek(wth->random_fh, seek_increment, SEEK_CUR, err) == -1)
+ return FALSE;
+ }
+
/* read in the packet */
bytes_read = file_read(pd, 1, length, wth->random_fh);
if (bytes_read != length) {