aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/ipfix.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-12-13 09:53:50 +0000
committerGuy Harris <guy@alum.mit.edu>2011-12-13 09:53:50 +0000
commitd94bd07f99438278cb11f24b00571ab2907b6bdb (patch)
tree5f96d0a35c97af466bcb2d5b8a9371327bb0190f /wiretap/ipfix.c
parent1df4ee91090e35c25835204d7175b9395be32606 (diff)
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/ipfix.c')
-rw-r--r--wiretap/ipfix.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/wiretap/ipfix.c b/wiretap/ipfix.c
index 5bd08f58b2..cdfcdc53e9 100644
--- a/wiretap/ipfix.c
+++ b/wiretap/ipfix.c
@@ -140,13 +140,13 @@ ipfix_read_message_header(ipfix_message_header_t *pfx_hdr, FILE_T fh, int *err,
/* is the version number one we expect? */
if (pfx_hdr->version != IPFIX_VERSION) {
/* Not an ipfix file. */
- *err = WTAP_ERR_BAD_RECORD;
+ *err = WTAP_ERR_BAD_FILE;
*err_info = g_strdup_printf("ipfix: wrong version %d", pfx_hdr->version);
return FALSE;
}
if (pfx_hdr->message_length < 16) {
- *err = WTAP_ERR_BAD_RECORD;
+ *err = WTAP_ERR_BAD_FILE;
*err_info = g_strdup_printf("ipfix: message length %u is too short", pfx_hdr->message_length);
return FALSE;
}
@@ -193,7 +193,7 @@ ipfix_open(wtap *wth, int *err, gchar **err_info)
if (!ipfix_read_message_header(&msg_hdr, wth->fh, err, err_info)) {
ipfix_debug3("ipfix_open: couldn't read message header #%d with err code #%d (%s)",
i, *err, *err_info);
- if (*err == WTAP_ERR_BAD_RECORD) {
+ if (*err == WTAP_ERR_BAD_FILE) {
*err = 0; /* not actually an error in this case */
g_free(*err_info);
*err_info = NULL;
@@ -313,7 +313,7 @@ ipfix_seek_read(wtap *wth, gint64 seek_off,
}
if(length != (int)msg_hdr.message_length) {
- *err = WTAP_ERR_BAD_RECORD;
+ *err = WTAP_ERR_BAD_FILE;
*err_info = g_strdup_printf("ipfix: record length %u doesn't match requested length %d",
msg_hdr.message_length, length);
ipfix_debug1("ipfix_seek_read: %s", *err_info);