diff options
author | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-06-30 02:31:15 +0000 |
---|---|---|
committer | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-06-30 02:31:15 +0000 |
commit | 050743f8a79edf4497158ea598534a82809c1e49 (patch) | |
tree | 87b9dd4bb6e06f72520b8848593d6f8eea471ad4 /wiretap/network_instruments.c | |
parent | 31ee79f6bef6b224925172c152f1934eef361d2e (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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14822 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'wiretap/network_instruments.c')
-rw-r--r-- | wiretap/network_instruments.c | 12 |
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) { |