mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-12-27 05:05:37 +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")
|
||||
}
|
||||
var options dns.QueryOptions
|
||||
if ruleIndex < len(r.dnsRules) {
|
||||
dnsRules := r.dnsRules
|
||||
var (
|
||||
currentRuleIndex int
|
||||
currentRule adapter.DNSRule
|
||||
)
|
||||
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 {
|
||||
continue
|
||||
}
|
||||
metadata.ResetRuleCache()
|
||||
if currentRule.Match(metadata) {
|
||||
displayRuleIndex := currentRuleIndex
|
||||
if displayRuleIndex != -1 {
|
||||
displayRuleIndex += displayRuleIndex + 1
|
||||
if ruleIndex != -1 {
|
||||
displayRuleIndex += ruleIndex + 1
|
||||
}
|
||||
ruleDescription := currentRule.String()
|
||||
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 {
|
||||
options.Strategy = domainStrategy
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user