diff options
Diffstat (limited to 'wiretap/ngsniffer.c')
-rw-r--r-- | wiretap/ngsniffer.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c index 2ccddaa2b9..533ce0f3c0 100644 --- a/wiretap/ngsniffer.c +++ b/wiretap/ngsniffer.c @@ -2026,6 +2026,15 @@ ngsniffer_dump(wtap_dumper *wdh, const wtap_rec *rec, return FALSE; } + /* + * Make sure this packet doesn't have a link-layer type that + * differs from the one for the file. + */ + if (wdh->encap != rec->rec_header.packet_header.pkt_encap) { + *err = WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED; + return FALSE; + } + /* The captured length field is 16 bits, so there's a hard limit of 65535. */ if (rec->rec_header.packet_header.caplen > 65535) { |