summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliuchang <[email protected]>2023-09-11 03:05:45 +0000
committerliuchang <[email protected]>2023-09-11 03:05:45 +0000
commitf81ebf3c9cd180672eeb490f01f888264b993bb7 (patch)
treed0a96546845fbcd40f5a76b1625e538ac2c5c340
parentc24ddcec291cb832a156a5f7795ea4ebacc0c105 (diff)
bugfix: TSG-16963, don't update metric for disabled rules
-rw-r--r--shaping/src/shaper.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/shaping/src/shaper.cpp b/shaping/src/shaper.cpp
index 5f15d23..09a0c24 100644
--- a/shaping/src/shaper.cpp
+++ b/shaping/src/shaper.cpp
@@ -703,8 +703,11 @@ static enum shaping_packet_action shaper_pkt_action_decide_queueing(struct shapi
for (int i = 0; i < profile_num; i++) {
profile = pf_container[i].pf_info;
profile_type = pf_container[i].pf_type;
- if (0 == shaper_token_consume(ctx, sf, pkt_wrapper->length, profile, profile_type, pkt_wrapper->direction)) {
- shaper_stat_forward_inc(&profile->stat, pkt_wrapper->direction, pkt_wrapper->length, ctx->thread_index);
+ int ret = shaper_token_consume(ctx, sf, pkt_wrapper->length, profile, profile_type, pkt_wrapper->direction);
+ if (ret >= SHAPER_TOKEN_GET_SUCCESS) {
+ if (ret == SHAPER_TOKEN_GET_SUCCESS) {
+ shaper_stat_forward_inc(&profile->stat, pkt_wrapper->direction, pkt_wrapper->length, ctx->thread_index);
+ }
get_token_success = 1;
break;
}