diff options
Diffstat (limited to 'wiretap/netxray.c')
-rw-r--r-- | wiretap/netxray.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/wiretap/netxray.c b/wiretap/netxray.c index e6dd704bb3..1a7465453d 100644 --- a/wiretap/netxray.c +++ b/wiretap/netxray.c @@ -1590,6 +1590,7 @@ netxray_process_rec_header(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, break; } + phdr->rec_type = REC_TYPE_PACKET; if (netxray->version_major == 0) { phdr->presence_flags = WTAP_HAS_TS; t = (double)pletoh32(&hdr.old_hdr.timelo) @@ -1738,6 +1739,12 @@ netxray_dump_1_1(wtap_dumper *wdh, guint32 t32; struct netxrayrec_1_x_hdr rec_hdr; + /* We can only write packet records. */ + if (phdr->rec_type != REC_TYPE_PACKET) { + *err = WTAP_ERR_REC_TYPE_UNSUPPORTED; + return FALSE; + } + /* The captured length field is 16 bits, so there's a hard limit of 65535. */ if (phdr->caplen > 65535) { @@ -1911,6 +1918,12 @@ netxray_dump_2_0(wtap_dumper *wdh, guint32 t32; struct netxrayrec_2_x_hdr rec_hdr; + /* We can only write packet records. */ + if (phdr->rec_type != REC_TYPE_PACKET) { + *err = WTAP_ERR_REC_TYPE_UNSUPPORTED; + return FALSE; + } + /* Don't write anything we're not willing to read. */ if (phdr->caplen > WTAP_MAX_PACKET_SIZE) { *err = WTAP_ERR_PACKET_TOO_LARGE; |