mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-14 21:31:16 +08:00
fix: whitelist
This commit is contained in:
parent
0368bb4180
commit
0947cb4a5a
@ -46,14 +46,18 @@ func (sd *SnifferDispatcher) TCPSniff(conn net.Conn, metadata *C.Metadata) {
|
||||
return
|
||||
}
|
||||
|
||||
inWhitelist := false
|
||||
for _, portRange := range *sd.portRanges {
|
||||
if !portRange.Contains(uint16(port)) {
|
||||
return
|
||||
} else {
|
||||
if portRange.Contains(uint16(port)) {
|
||||
inWhitelist = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !inWhitelist {
|
||||
return
|
||||
}
|
||||
|
||||
if host, err := sd.sniffDomain(bufConn, metadata); err != nil {
|
||||
log.Debugln("[Sniffer] All sniffing sniff failed with from [%s:%s] to [%s:%s]", metadata.SrcIP, metadata.SrcPort, metadata.String(), metadata.DstPort)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user