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:
世界
2026-11-25 23:44:43 +08:00
parent 43a6cf39f5
commit d90278cd51
+2 -8
View File
@@ -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) {