summaryrefslogtreecommitdiff
path: root/zebra/zebra_ns.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-08-27 14:36:46 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-10-24 06:53:09 -0400
commit7f0ea8a4a23f4500421e89268b442cf145d0d75f (patch)
treec0ed158240450cff618b54cfe61ab9775ae1ba98 /zebra/zebra_ns.c
parent89272910f738c05ba7986e7d91c14dc0eb1f6ba6 (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_ns.c')
-rw-r--r--zebra/zebra_ns.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/zebra/zebra_ns.c b/zebra/zebra_ns.c
index 75cacc04e1..300989e33c 100644
--- a/zebra/zebra_ns.c
+++ b/zebra/zebra_ns.c
@@ -121,10 +121,6 @@ int zebra_ns_enable(ns_id_t ns_id, void **info)
zns->ns_id = ns_id;
- zns->rules_hash =
- hash_create_size(8, zebra_pbr_rules_hash_key,
- zebra_pbr_rules_hash_equal, "Rules Hash");
-
zns->ipset_hash =
hash_create_size(8, zebra_pbr_ipset_hash_key,
zebra_pbr_ipset_hash_equal, "IPset Hash");
@@ -157,9 +153,8 @@ int zebra_ns_disable(ns_id_t ns_id, void **info)
{
struct zebra_ns *zns = (struct zebra_ns *)(*info);
- hash_clean(zns->rules_hash, zebra_pbr_rules_free);
- hash_free(zns->rules_hash);
- hash_clean(zns->ipset_entry_hash, zebra_pbr_ipset_entry_free);
+ hash_clean(zns->ipset_entry_hash,
+ zebra_pbr_ipset_entry_free),
hash_clean(zns->ipset_hash, zebra_pbr_ipset_free);
hash_free(zns->ipset_hash);
hash_free(zns->ipset_entry_hash);
@@ -216,6 +211,7 @@ int zebra_ns_init(void)
zebra_ns_notify_parse();
zebra_ns_notify_init();
}
+
return 0;
}