From 5d9d8f4d3bb6563563f37bef56fb1a09906995c6 Mon Sep 17 00:00:00 2001 From: laburaps Date: Tue, 10 Dec 2024 16:15:08 +0800 Subject: [PATCH] fix: check whether the dst port is within the specified range (#1706) --- component/sniffer/dispatcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/component/sniffer/dispatcher.go b/component/sniffer/dispatcher.go index 4d13ddd0..f198c4ae 100644 --- a/component/sniffer/dispatcher.go +++ b/component/sniffer/dispatcher.go @@ -146,7 +146,7 @@ func (sd *Dispatcher) Enable() bool { func (sd *Dispatcher) sniffDomain(conn *N.BufferedConn, metadata *C.Metadata) (string, error) { for s := range sd.sniffers { - if s.SupportNetwork() == C.TCP { + if s.SupportNetwork() == C.TCP && s.SupportPort(metadata.DstPort) { _ = conn.SetReadDeadline(time.Now().Add(1 * time.Second)) _, err := conn.Peek(1) _ = conn.SetReadDeadline(time.Time{})