From b6c940af612b48bb6551e44f1ec0a4fe8e9acdf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Mon, 11 Nov 2024 16:06:56 +0800 Subject: [PATCH] Fix match rules --- route/route.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/route/route.go b/route/route.go index d44c516e..0e3f8916 100644 --- a/route/route.go +++ b/route/route.go @@ -467,7 +467,12 @@ match: selectedRuleIndex = currentRuleIndex break match } - ruleIndex = currentRuleIndex + if ruleIndex == -1 { + ruleIndex = currentRuleIndex + } else { + ruleIndex += currentRuleIndex + } + ruleIndex++ } if !preMatch && metadata.Destination.Addr.IsUnspecified() { newBuffer, newPacketBuffers, newErr := r.actionSniff(ctx, metadata, &rule.RuleActionSniff{}, inputConn, inputPacketConn)