diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-12-31 23:31:44 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-12-31 23:31:44 +0000 |
commit | cd13dd378234c8a75e4852a7edfcbb01453559f2 (patch) | |
tree | e7c615918cfb5b0e6085ed8cb21395c03d557407 /wiretap/netscreen.c | |
parent | 31d74c1922daae28586efa2a18ae1f7887e0d85c (diff) |
Use the packet length read from the packet header when reading packets
randomly.
svn path=/trunk/; revision=54518
Diffstat (limited to 'wiretap/netscreen.c')
-rw-r--r-- | wiretap/netscreen.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/wiretap/netscreen.c b/wiretap/netscreen.c index 947cc8a533..80ef74cc19 100644 --- a/wiretap/netscreen.c +++ b/wiretap/netscreen.c @@ -208,8 +208,8 @@ static gboolean netscreen_read(wtap *wth, int *err, gchar **err_info, return FALSE; /* Parse the header */ - pkt_len = parse_netscreen_rec_hdr(&wth->phdr, line, cap_int, &cap_dir, cap_dst, - err, err_info); + pkt_len = parse_netscreen_rec_hdr(&wth->phdr, line, cap_int, &cap_dir, + cap_dst, err, err_info); if (pkt_len == -1) return FALSE; @@ -241,9 +241,10 @@ static gboolean netscreen_read(wtap *wth, int *err, gchar **err_info, /* Used to read packets in random-access fashion */ static gboolean netscreen_seek_read(wtap *wth, gint64 seek_off, - struct wtap_pkthdr *phdr, Buffer *buf, int len, + struct wtap_pkthdr *phdr, Buffer *buf, int len _U_, int *err, gchar **err_info) { + int pkt_len; char line[NETSCREEN_LINE_LENGTH]; char cap_int[NETSCREEN_MAX_INT_NAME_LENGTH]; gboolean cap_dir; @@ -261,13 +262,13 @@ netscreen_seek_read(wtap *wth, gint64 seek_off, return FALSE; } - if (parse_netscreen_rec_hdr(phdr, line, cap_int, &cap_dir, cap_dst, - err, err_info) == -1) { + pkt_len = parse_netscreen_rec_hdr(phdr, line, cap_int, &cap_dir, + cap_dst, err, err_info); + if (pkt_len == -1) return FALSE; - } - if (!parse_netscreen_hex_dump(wth->random_fh, len, cap_int, cap_dst, - phdr, buf, err, err_info)) + if (!parse_netscreen_hex_dump(wth->random_fh, pkt_len, cap_int, + cap_dst, phdr, buf, err, err_info)) return FALSE; return TRUE; } |