From 31545a5a221176e6077205fa8ad796b0025e3438 Mon Sep 17 00:00:00 2001 From: VaiTon Date: Mon, 5 Jun 2023 16:14:44 +0200 Subject: Warn on pcap packet error --- pcap_importer.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pcap_importer.go b/pcap_importer.go index 4cca916..0df4bcb 100644 --- a/pcap_importer.go +++ b/pcap_importer.go @@ -224,6 +224,7 @@ func (pi *PcapImporter) parsePcap(session ImportingSession, fileName string, flu if packet.NetworkLayer() == nil || packet.TransportLayer() == nil || packet.TransportLayer().LayerType() != layers.LayerTypeTCP { // invalid packet + log.Warn("Invalid packet: no network or transport layer") session.InvalidPackets++ continue } @@ -241,6 +242,7 @@ func (pi *PcapImporter) parsePcap(session ImportingSession, fileName string, flu servicePort = uint16(tcp.SrcPort) index = 1 } else { + log.Warn("Invalid packet: source and destination are the same") session.InvalidPackets++ continue } -- cgit v1.2.3-70-g09d2