diff options
author | Florin Coras <fcoras@cisco.com> | 2017-11-02 21:31:46 -0700 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2017-11-03 08:19:41 +0000 |
commit | f0c1c96b0be1552deff0fbfc62db4ce510cb700d (patch) | |
tree | 07f33ac6b10567325ccd125be5b2b3a810175b96 /src/vnet/session/mma_template.c | |
parent | 77eb3a936adfe455ed1a450560c4f0f5d8a28ea4 (diff) |
session: support drop action in rules table
Change-Id: Ided2980373ed5329c68f958f61be893428bccd31
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/mma_template.c')
-rw-r--r-- | src/vnet/session/mma_template.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/vnet/session/mma_template.c b/src/vnet/session/mma_template.c index a8386695944..6efb2ff61ab 100644 --- a/src/vnet/session/mma_template.c +++ b/src/vnet/session/mma_template.c @@ -99,11 +99,11 @@ RT (mma_rules_table_lookup) (RTT (mma_rules_table) * srt, ASSERT (rp); if (!RT (rule_is_match_for_key) (key, rp)) - return ~0; + return SESSION_RULES_TABLE_INVALID_INDEX; for (i = 0; i < vec_len (rp->next_indices); i++) { rv = RT (mma_rules_table_lookup) (srt, key, rp->next_indices[i]); - if (rv != ~0) + if (rv != SESSION_RULES_TABLE_INVALID_INDEX) return (rv); } return (rp->action_index); @@ -123,11 +123,11 @@ RT (mma_rules_table_lookup_rule) (RTT (mma_rules_table) * srt, ASSERT (rp); if (!RT (rule_is_match_for_key) (key, rp)) - return ~0; + return SESSION_RULES_TABLE_INVALID_INDEX; for (i = 0; i < vec_len (rp->next_indices); i++) { rv = RT (mma_rules_table_lookup_rule) (srt, key, rp->next_indices[i]); - if (rv != ~0) + if (rv != SESSION_RULES_TABLE_INVALID_INDEX) return (rv); } return rule_index; @@ -218,7 +218,7 @@ RT (mma_rules_table_del_rule) (RTT (mma_rules_table) * srt, rp = RT (mma_rules_table_get_rule) (srt, rule_index); if (!RT (rule_is_match_for_key) (&rule->match, rp)) - return ~0; + return SESSION_RULES_TABLE_INVALID_INDEX; if (RT (rule_is_exact_match) (rule, rp)) { if (rule_index == srt->root_index) @@ -257,7 +257,7 @@ RT (mma_rules_table_del_rule) (RTT (mma_rules_table) * srt, else if (rv == 0) return rv; } - return ~0; + return SESSION_RULES_TABLE_INVALID_INDEX; } /* |