aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/commview.c
diff options
context:
space:
mode:
Diffstat (limited to 'wiretap/commview.c')
-rw-r--r--wiretap/commview.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/wiretap/commview.c b/wiretap/commview.c
index e2a868a6b2..b9ad83bfd0 100644
--- a/wiretap/commview.c
+++ b/wiretap/commview.c
@@ -173,6 +173,7 @@ commview_read_packet(FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf,
tm.tm_sec = cv_hdr.seconds;
tm.tm_isdst = -1;
+ phdr->rec_type = REC_TYPE_PACKET;
phdr->presence_flags = WTAP_HAS_TS;
phdr->len = cv_hdr.data_len;
@@ -275,6 +276,12 @@ static gboolean commview_dump(wtap_dumper *wdh,
commview_header_t cv_hdr;
struct tm *tm;
+ /* We can only write packet records. */
+ if (phdr->rec_type != REC_TYPE_PACKET) {
+ *err = WTAP_ERR_REC_TYPE_UNSUPPORTED;
+ return FALSE;
+ }
+
/* Don't write out anything bigger than we can read.
* (The length field in packet headers is 16 bits, which
* imposes a hard limit.) */