From 833b43a538b0d1831b7e68c355c2d390d70c6147 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Mon, 6 Dec 2021 21:44:43 +0800 Subject: [PATCH] Fixed: Does RuleSet resolve ip logic modification --- rule/provider.go | 2 +- rule/rule_set.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rule/provider.go b/rule/provider.go index 48022fb2..74acddbd 100644 --- a/rule/provider.go +++ b/rule/provider.go @@ -126,7 +126,6 @@ func NewRuleSetProvider(name string, behavior P.RuleType, interval time.Duration return err } - rp.shouldResolveIP = false rp.setRules(rules) return nil } @@ -242,5 +241,6 @@ func (rp *ruleSetProvider) setRules(rules interface{}) { rp.IPCIDRRules = rules.(*trie.IpCidrTrie) rp.shouldResolveIP = true default: + rp.shouldResolveIP = false } } diff --git a/rule/rule_set.go b/rule/rule_set.go index 1815d999..07f18bd0 100644 --- a/rule/rule_set.go +++ b/rule/rule_set.go @@ -30,7 +30,7 @@ func (rs *RuleSet) Payload() string { } func (rs *RuleSet) ShouldResolveIP() bool { - return rs.getProviders().Behavior() != P.Domain + return rs.getProviders().ShouldResolveIP() } func (rs *RuleSet) getProviders() P.RuleProvider { if rs.ruleProvider == nil {