aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/netscreen.c
diff options
context:
space:
mode:
authorSake Blok <sake@euronet.nl>2007-09-01 11:14:01 +0000
committerSake Blok <sake@euronet.nl>2007-09-01 11:14:01 +0000
commit98be4e676e33caef451fc5fe4523cfa7d98c05e9 (patch)
tree622969acf96c432e640069b44ece70eab7a0d3ac /wiretap/netscreen.c
parent81f968f7486796a56a479040dcad8e9f40fd5d1a (diff)
This patch solves two issue with the NetScreen wiretap routine:
- It accepts the "/" character in interface names - It accepts EOF as delimiter for the last packet (when there is no more emptyline) svn path=/trunk/; revision=22765
Diffstat (limited to 'wiretap/netscreen.c')
-rw-r--r--wiretap/netscreen.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/wiretap/netscreen.c b/wiretap/netscreen.c
index 2cc24c351d..8b63a75f53 100644
--- a/wiretap/netscreen.c
+++ b/wiretap/netscreen.c
@@ -312,7 +312,7 @@ parse_netscreen_rec_hdr(wtap *wth, const char *line, char *cap_int, gboolean *ca
int dsec, pkt_len;
char direction[2];
- if (sscanf(line, "%d.%d: %[a-z0-9](%[io]) len=%d:",
+ if (sscanf(line, "%d.%d: %[a-z0-9/](%[io]) len=%d:",
&sec, &dsec, cap_int, direction, &pkt_len) != 5) {
*err = WTAP_ERR_BAD_RECORD;
*err_info = g_strdup("netscreen: Can't parse packet-header");
@@ -339,15 +339,15 @@ parse_netscreen_hex_dump(FILE_T fh, int pkt_len, guint8* buf, int *err, gchar **
int n, i = 0, offset = 0;
while(1) {
+
+ /* The last packet is not delimited by an empty line, but by EOF
+ * So accept EOF as a valid delimiter too
+ */
if (file_gets(line, NETSCREEN_LINE_LENGTH, fh) == NULL) {
- *err = file_error(fh);
- if (*err == 0) {
- *err = WTAP_ERR_SHORT_READ;
- }
- return -1;
+ break;
}
- /* packeta are delimited with empty lines */
+ /* packets are delimited with empty lines */
if (empty_line(line)) {
break;
}