refactor: remove unused StopOnFirstMatch field from MatchingConfig

Remove StopOnFirstMatch field that was defined but never used in the
actual matching logic.

The current implementation always evaluates all rule types and applies
a fixed precedence (Domain > MAC > Network), making the StopOnFirstMatch
field unnecessary.

Changes:
- Remove StopOnFirstMatch from MatchingConfig structs
- Update DefaultMatchingConfig() function
- Update all test cases and references
- Simplify configuration to only include Order field

This cleanup removes dead code and simplifies the configuration API
without changing any functional behavior.
This commit is contained in:
Cuong Manh Le
2025-09-16 18:56:47 +07:00
committed by Cuong Manh Le
parent c365051732
commit 9b1f102315
5 changed files with 8 additions and 17 deletions
+1 -2
View File
@@ -317,8 +317,7 @@ func (lc *ListenerConfig) IsDirectDnsListener() bool {
// MatchingConfig defines the configuration for rule matching behavior
type MatchingConfig struct {
Order []string `mapstructure:"order" toml:"order,omitempty" json:"order" yaml:"order"`
StopOnFirstMatch bool `mapstructure:"stop_on_first_match" toml:"stop_on_first_match,omitempty" json:"stop_on_first_match" yaml:"stop_on_first_match"`
Order []string `mapstructure:"order" toml:"order,omitempty" json:"order" yaml:"order"`
}
// ListenerPolicyConfig specifies the policy rules for ctrld to filter incoming requests.