Skip to content

Commit

Permalink
fix: check whether the dst port is within the specified range
Browse files Browse the repository at this point in the history
  • Loading branch information
laburaps committed Dec 10, 2024
1 parent f3a43fe commit 6da8e6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion component/sniffer/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
Expand Down

0 comments on commit 6da8e6b

Please sign in to comment.