diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-12-31 23:32:30 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-12-31 23:32:30 +0000 |
commit | eeda7ec1aea880f1ee951d1b3188693d88a98b55 (patch) | |
tree | 25b6c6d8c7cbf16994d02b5dbb4b9d3390ab87ec /wiretap/netmon.c | |
parent | cd13dd378234c8a75e4852a7edfcbb01453559f2 (diff) |
Use the packet length read from the packet header when reading packets
randomly.
svn path=/trunk/; revision=54519
Diffstat (limited to 'wiretap/netmon.c')
-rw-r--r-- | wiretap/netmon.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/wiretap/netmon.c b/wiretap/netmon.c index 7ec1668693..bf5eec3cee 100644 --- a/wiretap/netmon.c +++ b/wiretap/netmon.c @@ -748,7 +748,7 @@ again: static gboolean netmon_seek_read(wtap *wth, gint64 seek_off, - struct wtap_pkthdr *phdr, Buffer *buf, int length, + struct wtap_pkthdr *phdr, Buffer *buf, int length _U_, int *err, gchar **err_info) { netmon_t *netmon = (netmon_t *)wth->priv; @@ -763,7 +763,8 @@ netmon_seek_read(wtap *wth, gint64 seek_off, /* * Read the packet data. */ - if (!wtap_read_packet_bytes(wth->random_fh, buf, length, err, err_info)) + if (!wtap_read_packet_bytes(wth->random_fh, buf, phdr->caplen, err, + err_info)) return FALSE; /* |