diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-08-27 14:36:46 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-10-24 06:53:09 -0400 |
| commit | 7f0ea8a4a23f4500421e89268b442cf145d0d75f (patch) | |
| tree | c0ed158240450cff618b54cfe61ab9775ae1ba98 /zebra/zebra_router.c | |
| parent | 89272910f738c05ba7986e7d91c14dc0eb1f6ba6 (diff) | |
zebra: Move rules_hash to zrouter
Move the rules_hash to the zrouter data structure and provide
the additional bit of work needed to lookup the rule based upon
the namespace id as well. Make the callers of functions not
care about what namespace id we are in.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_router.c')
| -rw-r--r-- | zebra/zebra_router.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c index 1116848a89..94d7ab1b8c 100644 --- a/zebra/zebra_router.c +++ b/zebra/zebra_router.c @@ -23,6 +23,7 @@ #include "zebra_router.h" #include "zebra_memory.h" +#include "zebra_pbr.h" struct zebra_router zrouter; @@ -154,9 +155,16 @@ void zebra_router_terminate(void) RB_REMOVE(zebra_router_table_head, &zrouter.tables, zrt); zebra_router_free_table(zrt); } + + hash_clean(zrouter.rules_hash, zebra_pbr_rules_free); + hash_free(zrouter.rules_hash); } void zebra_router_init(void) { zrouter.l3vni_table = NULL; + + zrouter.rules_hash = hash_create_size(8, zebra_pbr_rules_hash_key, + zebra_pbr_rules_hash_equal, + "Rules Hash"); } |
