From 2d2a269b533bc0be5aeab688b97c0e6421466d37 Mon Sep 17 00:00:00 2001 From: brl Date: Tue, 15 Dec 2015 03:48:37 +0000 Subject: [PATCH] improve log output --- policy.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/policy.go b/policy.go index 054dd9d..d9b829b 100644 --- a/policy.go +++ b/policy.go @@ -162,16 +162,14 @@ func (fw *Firewall) filterPacket(pkt *nfqueue.Packet) { fw.dns.processDNS(pkt) return } - log.Debug("filterPacket %s", printPacket(pkt, fw.dns.Lookup(pkt.Dst))) - if basicAllowPacket(pkt) { + proc := findProcessForPacket(pkt) + if proc == nil { + log.Warning("No proc found for %s", printPacket(pkt, fw.dns.Lookup(pkt.Dst))) pkt.Accept() return } - - proc := findProcessForPacket(pkt) - - if proc == nil { - log.Warning("No process for: %v", pkt) + log.Debug("filterPacket [%s] %s", proc.exePath, printPacket(pkt, fw.dns.Lookup(pkt.Dst))) + if basicAllowPacket(pkt) { pkt.Accept() return }