Fix match rules

This commit is contained in:
世界 2024-11-11 16:06:56 +08:00
parent 1edb80adcc
commit b6c940af61
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4

View File

@ -467,7 +467,12 @@ match:
selectedRuleIndex = currentRuleIndex selectedRuleIndex = currentRuleIndex
break match break match
} }
ruleIndex = currentRuleIndex if ruleIndex == -1 {
ruleIndex = currentRuleIndex
} else {
ruleIndex += currentRuleIndex
}
ruleIndex++
} }
if !preMatch && metadata.Destination.Addr.IsUnspecified() { if !preMatch && metadata.Destination.Addr.IsUnspecified() {
newBuffer, newPacketBuffers, newErr := r.actionSniff(ctx, metadata, &rule.RuleActionSniff{}, inputConn, inputPacketConn) newBuffer, newPacketBuffers, newErr := r.actionSniff(ctx, metadata, &rule.RuleActionSniff{}, inputConn, inputPacketConn)