From cc752f8e1887d68fdb226ebb54066f9a1e20f6e2 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 19 Aug 2023 13:59:44 +0200 Subject: [PATCH] Ignore DNS request connection from kernel --- network/dns.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/network/dns.go b/network/dns.go index 355fb65d..b1f729c7 100644 --- a/network/dns.go +++ b/network/dns.go @@ -54,8 +54,9 @@ func getDNSRequestConnectionKey(packetInfo *packet.Info) (id string, ok bool) { // SaveDNSRequestConnection saves a dns request connection for later retrieval. func SaveDNSRequestConnection(conn *Connection, pkt packet.Packet) { // Check connection. - if conn.PID == process.UndefinedProcessID { - log.Tracer(pkt.Ctx()).Tracef("network: not saving dns request connection because the PID is undefined") + if conn.PID == process.UndefinedProcessID || conn.PID == process.SystemProcessID { + // When re-injecting packets on Windows, they are reported with kernel PID (4). + log.Tracer(pkt.Ctx()).Tracef("network: not saving dns request connection because the PID is undefined/kernel") return }