complete match_only

This commit is contained in:
n3t1zen
2026-05-06 01:35:53 +08:00
parent 9fdd855bd5
commit 9460e860b0
5 changed files with 77 additions and 13 deletions
+8
View File
@@ -8,3 +8,11 @@
for _, address := range metadata.DestinationAddresses {
if address.Is6() {
newDestination = address
@@ -796,6 +797,7 @@
return err
}
metadata.DestinationAddresses = addresses
+ metadata.IgnoreDestinationAddresses = action.MatchOnly
r.logger.DebugContext(ctx, "resolved [", strings.Join(F.MapToString(metadata.DestinationAddresses), " "), "]")
}
return nil
@@ -0,0 +1,18 @@
--- a/route/rule/rule_action.go
+++ b/route/rule/rule_action.go
@@ -112,6 +112,7 @@
DisableCache: action.ResolveOptions.DisableCache,
RewriteTTL: action.ResolveOptions.RewriteTTL,
ClientSubnet: action.ResolveOptions.ClientSubnet.Build(netip.Prefix{}),
+ MatchOnly: action.ResolveOptions.MatchOnly,
}, nil
default:
panic(F.ToString("unknown rule action: ", action.Action))
@@ -476,6 +477,7 @@
DisableCache bool
RewriteTTL *uint32
ClientSubnet netip.Prefix
+ MatchOnly bool
}
func (r *RuleActionResolve) Type() string {