mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-12-01 14:18:36 +00:00
Fix address filter matching for inverted legacy DNS rules with rule-sets
A rule-set that is not merged into the outer rule is an additional condition of it, so its match still depends on deferred address filter conditions after the outer destination address items match. Pre-lookup matching cleared that dependency with the outer rule's satisfied groups, so inverted rules combining destination address items with such a rule-set were rejected before the lookup instead of being decided by the response.
This commit is contained in:
@@ -73,16 +73,10 @@ func (r *abstractDefaultRule) matchInner(metadata *adapter.InboundContext) bool
|
||||
return false
|
||||
}
|
||||
}
|
||||
var matched bool
|
||||
if r.ruleSetItem != nil {
|
||||
matched = r.ruleSetItem.matchWithOuterGroups(metadata, groups)
|
||||
} else {
|
||||
matched = groups.done()
|
||||
return r.ruleSetItem.matchWithOuterGroups(metadata, groups)
|
||||
}
|
||||
if matched {
|
||||
metadata.DeferredIPCIDRMatchGroups &^= uint8(groups.satisfied)
|
||||
}
|
||||
return matched
|
||||
return groups.done()
|
||||
}
|
||||
|
||||
func (r *abstractDefaultRule) evaluateForMerge(metadata *adapter.InboundContext) (ruleGroupMatch, bool) {
|
||||
|
||||
Reference in New Issue
Block a user