mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-12-27 20:55:39 +08:00
Fix DNS match log
This commit is contained in:
parent
dda692e955
commit
5952c174f7
|
@ -45,20 +45,22 @@ func (r *Router) matchDNS(ctx context.Context, allowFakeIP bool, ruleIndex int,
|
||||||
panic("no context")
|
panic("no context")
|
||||||
}
|
}
|
||||||
var options dns.QueryOptions
|
var options dns.QueryOptions
|
||||||
if ruleIndex < len(r.dnsRules) {
|
var (
|
||||||
dnsRules := r.dnsRules
|
currentRuleIndex int
|
||||||
|
currentRule adapter.DNSRule
|
||||||
|
)
|
||||||
if ruleIndex != -1 {
|
if ruleIndex != -1 {
|
||||||
dnsRules = dnsRules[ruleIndex+1:]
|
currentRuleIndex = ruleIndex + 1
|
||||||
}
|
}
|
||||||
for currentRuleIndex, currentRule := range dnsRules {
|
for currentRuleIndex, currentRule = range r.dnsRules[currentRuleIndex:] {
|
||||||
if currentRule.WithAddressLimit() && !isAddressQuery {
|
if currentRule.WithAddressLimit() && !isAddressQuery {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
metadata.ResetRuleCache()
|
metadata.ResetRuleCache()
|
||||||
if currentRule.Match(metadata) {
|
if currentRule.Match(metadata) {
|
||||||
displayRuleIndex := currentRuleIndex
|
displayRuleIndex := currentRuleIndex
|
||||||
if displayRuleIndex != -1 {
|
if ruleIndex != -1 {
|
||||||
displayRuleIndex += displayRuleIndex + 1
|
displayRuleIndex += ruleIndex + 1
|
||||||
}
|
}
|
||||||
ruleDescription := currentRule.String()
|
ruleDescription := currentRule.String()
|
||||||
if ruleDescription != "" {
|
if ruleDescription != "" {
|
||||||
|
@ -110,7 +112,6 @@ func (r *Router) matchDNS(ctx context.Context, allowFakeIP bool, ruleIndex int,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if domainStrategy, dsLoaded := r.transportDomainStrategy[r.defaultTransport]; dsLoaded {
|
if domainStrategy, dsLoaded := r.transportDomainStrategy[r.defaultTransport]; dsLoaded {
|
||||||
options.Strategy = domainStrategy
|
options.Strategy = domainStrategy
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user