diff options
author | Benoît Ganne <bganne@cisco.com> | 2019-09-06 13:43:16 +0200 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2019-09-23 15:30:29 +0000 |
commit | 44ca60ecdba866160bebbc6c1eb983674819d429 (patch) | |
tree | b0b647aa8eb80528cf5d6a78aa707f2afb3441e3 /src/plugins/gbp/gbp_contract.c | |
parent | 1df833e6deecaa1ca68d6e98af7fb109fc0ca18a (diff) |
gbp: fix contract rule handling
Fix a memory leak when removing old GBP contract rules and make sure a
GBP contract rule exists when matching the corresponding ACL rule.
Type: fix
Fixes: 13a08cc098
Change-Id: Iba67d573e69280ad998488a7a3d3462341c68ea4
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins/gbp/gbp_contract.c')
-rw-r--r-- | src/plugins/gbp/gbp_contract.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/gbp/gbp_contract.c b/src/plugins/gbp/gbp_contract.c index 452c5a5c359..e12b33145ce 100644 --- a/src/plugins/gbp/gbp_contract.c +++ b/src/plugins/gbp/gbp_contract.c @@ -73,6 +73,12 @@ gbp_rule_alloc (gbp_rule_action_t action, return (gu - gbp_rule_pool); } +void +gbp_rule_free (index_t gui) +{ + pool_put_index (gbp_rule_pool, gui); +} + index_t gbp_next_hop_alloc (const ip46_address_t * ip, index_t grd, const mac_address_t * mac, index_t gbd) @@ -139,6 +145,8 @@ gbp_contract_rules_free (index_t * rules) adj_unlock (gnh->gnh_ai[fproto]); } } + + gbp_rule_free (*gui); } vec_free (rules); } @@ -159,7 +167,7 @@ format_gbp_next_hop (u8 * s, va_list * args) return (s); } -static u8 * +u8 * format_gbp_rule_action (u8 * s, va_list * args) { gbp_rule_action_t action = va_arg (*args, gbp_rule_action_t); |