diff options
author | Guy Harris <guy@alum.mit.edu> | 2011-12-13 09:53:50 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2011-12-13 09:53:50 +0000 |
commit | d94bd07f99438278cb11f24b00571ab2907b6bdb (patch) | |
tree | 5f96d0a35c97af466bcb2d5b8a9371327bb0190f /wiretap/libpcap.c | |
parent | 1df4ee91090e35c25835204d7175b9395be32606 (diff) | |
download | wireshark-d94bd07f99438278cb11f24b00571ab2907b6bdb.tar.gz |
Rename WTAP_ERR_BAD_RECORD to WTAP_ERR_BAD_FILE; it really reports any
form of corruption/bogosity in a file, including in a file header as
well as in records in the file. Change the error message
wtap_strerror() returns for it to reflect that.
Use it for some file header problems for which it wasn't already being
used - WTAP_ERR_UNSUPPORTED shouldn't be used for that, it should only
be used for files that we have no reason to believe are invalid but that
have a version number we don't know about or some other
non-link-layer-encapsulation-type value we don't know about.
svn path=/trunk/; revision=40175
Diffstat (limited to 'wiretap/libpcap.c')
-rw-r--r-- | wiretap/libpcap.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c index c8e5cb7d74..c5d1b31738 100644 --- a/wiretap/libpcap.c +++ b/wiretap/libpcap.c @@ -528,7 +528,7 @@ static libpcap_try_t libpcap_try(wtap *wth, int *err) return THIS_FORMAT; } - if (*err == WTAP_ERR_BAD_RECORD) { + if (*err == WTAP_ERR_BAD_FILE) { /* * The first record is bogus, so this is probably * a corrupt file. Assume the file is in this @@ -567,7 +567,7 @@ static libpcap_try_t libpcap_try(wtap *wth, int *err) return THIS_FORMAT; } - if (*err == WTAP_ERR_BAD_RECORD) { + if (*err == WTAP_ERR_BAD_FILE) { /* * The second record is bogus; maybe it's a * Capture File From Hell, and what looks like @@ -762,7 +762,7 @@ static int libpcap_read_header(wtap *wth, int *err, gchar **err_info, * this is can tell when it's not the type we're guessing * it is. */ - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; if (err_info != NULL) { *err_info = g_strdup_printf("pcap: File has %u-byte packet, bigger than maximum of %u", hdr->hdr.incl_len, WTAP_MAX_PACKET_SIZE); @@ -779,7 +779,7 @@ static int libpcap_read_header(wtap *wth, int *err, gchar **err_info, * this is can tell when it's not the type we're guessing * it is. */ - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; if (err_info != NULL) { *err_info = g_strdup_printf("pcap: File has %u-byte packet, bigger than maximum of %u", hdr->hdr.orig_len, WTAP_MAX_PACKET_SIZE); @@ -953,7 +953,7 @@ static gboolean libpcap_dump(wtap_dumper *wdh, rec_hdr.hdr.orig_len = phdr->len + phdrsize; if (rec_hdr.hdr.incl_len > WTAP_MAX_PACKET_SIZE || rec_hdr.hdr.orig_len > WTAP_MAX_PACKET_SIZE) { - *err = WTAP_ERR_BAD_RECORD; + *err = WTAP_ERR_BAD_FILE; return FALSE; } |