diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-01-22 00:26:36 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-01-22 00:26:36 +0000 |
commit | 90d7c5f59b574e254bc1bb70aaaf12372fe97cc3 (patch) | |
tree | 7bc8e69b7cc459b8dfef190d1b33a7cb092a7bf3 /mergecap.c | |
parent | 5c825d6a364d83dace7b6c682aa47678e89df79b (diff) |
Don't write out packets that have a "captured length" bigger than we're
willing to read or that's bigger than will fit in the file format;
instead, report an error.
For the "I can't write a packet of that type in that file type" error,
report the file type in question.
svn path=/trunk/; revision=54882
Diffstat (limited to 'mergecap.c')
-rw-r--r-- | mergecap.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/mergecap.c b/mergecap.c index a317c4a307..578ab5e3d4 100644 --- a/mergecap.c +++ b/mergecap.c @@ -507,11 +507,24 @@ main(int argc, char *argv[]) case WTAP_ERR_UNSUPPORTED_ENCAP: /* - * This is a problem with the particular frame we're writing; - * note that, and give the frame number. + * This is a problem with the particular frame we're writing and + * the file type and subtype we're wwriting; note that, and + * report the frame number and file type/subtype. */ - fprintf(stderr, "mergecap: Frame %u of \"%s\" has a network type that can't be saved in a file with that format\n.", - in_file->packet_num, in_file->filename); + fprintf(stderr, "mergecap: Frame %u of \"%s\" has a network type that can't be saved in a \"%s\" file.\n", + in_file->packet_num, in_file->filename, + wtap_file_type_subtype_string(file_type)); + break; + + case WTAP_ERR_PACKET_TOO_LARGE: + /* + * This is a problem with the particular frame we're writing and + * the file type and subtype we're wwriting; note that, and + * report the frame number and file type/subtype. + */ + fprintf(stderr, "mergecap: Frame %u of \"%s\" is too large for a \"%s\" file\n.", + in_file->packet_num, in_file->filename, + wtap_file_type_subtype_string(file_type)); break; default: |