diff --git a/adapter/inbound.go b/adapter/inbound.go index d13adb5cc..5f6804aca 100644 --- a/adapter/inbound.go +++ b/adapter/inbound.go @@ -99,10 +99,9 @@ type InboundContext struct { SourceAddressMatch bool SourcePortMatch bool - DestinationAddressMatch bool - DestinationPortMatch bool - DidMatch bool - IgnoreDestinationIPCIDRMatch bool + DestinationAddressMatch bool + DestinationPortMatch bool + DidMatch bool } func (c *InboundContext) ResetRuleCache() { diff --git a/route/rule/rule_abstract.go b/route/rule/rule_abstract.go index ca508330b..8ec57aac3 100644 --- a/route/rule/rule_abstract.go +++ b/route/rule/rule_abstract.go @@ -60,7 +60,7 @@ func (r *abstractDefaultRule) destinationIPCIDRMatchesSource(metadata *adapter.I } func (r *abstractDefaultRule) destinationIPCIDRMatchesDestination(metadata *adapter.InboundContext) bool { - return !metadata.IgnoreDestinationIPCIDRMatch && !metadata.IPCIDRMatchSource && len(r.destinationIPCIDRItems) > 0 + return !metadata.IPCIDRMatchSource && len(r.destinationIPCIDRItems) > 0 } func (r *abstractDefaultRule) requiresSourceAddressMatch(metadata *adapter.InboundContext) bool { diff --git a/route/rule/rule_dns.go b/route/rule/rule_dns.go index f95fa6699..764deabf9 100644 --- a/route/rule/rule_dns.go +++ b/route/rule/rule_dns.go @@ -379,7 +379,6 @@ func (r *DefaultDNSRule) matchStatesForMatchWithMissingResponse(metadata *adapte return 0 } matchMetadata := *metadata - matchMetadata.IgnoreDestinationIPCIDRMatch = false matchMetadata.DestinationAddressMatchFromResponse = true return r.abstractDefaultRule.matchStates(&matchMetadata) } @@ -389,7 +388,6 @@ func (r *DefaultDNSRule) matchStatesForMatchWithMissingResponse(metadata *adapte func (r *DefaultDNSRule) MatchAddressLimit(metadata *adapter.InboundContext, response *dns.Msg) bool { matchMetadata := *metadata matchMetadata.DNSResponse = response - matchMetadata.IgnoreDestinationIPCIDRMatch = false matchMetadata.DestinationAddressMatchFromResponse = true return !r.abstractDefaultRule.matchStates(&matchMetadata).isEmpty() } @@ -511,7 +509,6 @@ func (r *LogicalDNSRule) LegacyPreMatch(metadata *adapter.InboundContext) bool { func (r *LogicalDNSRule) MatchAddressLimit(metadata *adapter.InboundContext, response *dns.Msg) bool { matchMetadata := *metadata matchMetadata.DNSResponse = response - matchMetadata.IgnoreDestinationIPCIDRMatch = false matchMetadata.DestinationAddressMatchFromResponse = true return !r.abstractLogicalRule.matchStates(&matchMetadata).isEmpty() }