From 9d364f66e9b5f9cd8adc54c048a57fd3b2a39d0c Mon Sep 17 00:00:00 2001 From: Skyxim Date: Sat, 16 Apr 2022 08:53:31 +0800 Subject: [PATCH] fix: reverse error when force is false --- component/sniffer/dispatcher.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/component/sniffer/dispatcher.go b/component/sniffer/dispatcher.go index 11d255bd..65ded52e 100644 --- a/component/sniffer/dispatcher.go +++ b/component/sniffer/dispatcher.go @@ -32,7 +32,7 @@ func (sd *SnifferDispatcher) forceReplace(conn *CN.BufferedConn, metadata *C.Met log.Debugln("[Sniffer]All sniffing sniff failed with from [%s:%s] to [%s:%s]", metadata.SrcIP, metadata.SrcPort, metadata.DstIP, metadata.DstPort) return } else { - if sd.force && sd.inReverse(host) { + if sd.inReverse(host) { log.Debugln("[Sniffer]Skip replace host:%s", host) return } @@ -42,7 +42,7 @@ func (sd *SnifferDispatcher) forceReplace(conn *CN.BufferedConn, metadata *C.Met } func (sd *SnifferDispatcher) replace(conn *CN.BufferedConn, metadata *C.Metadata) { - if metadata.Host != "" && sd.inReverse(metadata.Host) { + if metadata.Host != "" && !sd.inReverse(metadata.Host) { log.Debugln("[Sniffer]Skip Sniff domain:%s", metadata.Host) return }