]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_router.c
Merge pull request #12367 from rgirada/ospf_valgrind_fix
[mirror_frr.git] / zebra / zebra_router.c
index 6b4a7543cd17c2ba48dbdb62b38baf707cb92199..b8923ef57d9bc74cc19e3b224a06dcb402133dd5 100644 (file)
@@ -29,6 +29,8 @@
 #include "zebra_vxlan.h"
 #include "zebra_mlag.h"
 #include "zebra_nhg.h"
+#include "zebra_neigh.h"
+#include "zebra/zebra_tc.h"
 #include "debug.h"
 #include "zebra_script.h"
 
@@ -238,12 +240,14 @@ void zebra_router_terminate(void)
                zebra_router_free_table(zrt);
 
        work_queue_free_and_null(&zrouter.ribq);
-       meta_queue_free(zrouter.mq);
+       meta_queue_free(zrouter.mq, NULL);
 
        zebra_vxlan_disable();
        zebra_mlag_terminate();
+       zebra_neigh_terminate();
 
        /* Free NHE in ID table only since it has unhashable entries as well */
+       hash_iterate(zrouter.nhgs_id, zebra_nhg_hash_free_zero_id, NULL);
        hash_clean(zrouter.nhgs_id, zebra_nhg_hash_free);
        hash_free(zrouter.nhgs_id);
        hash_clean(zrouter.nhgs, NULL);
@@ -276,10 +280,15 @@ void zebra_router_init(bool asic_offload, bool notify_on_ack)
 {
        zrouter.sequence_num = 0;
 
+       zrouter.allow_delete = false;
+
        zrouter.packets_to_process = ZEBRA_ZAPI_PACKETS_TO_PROCESS;
 
+       zrouter.nhg_keep = ZEBRA_DEFAULT_NHG_KEEP_TIMER;
+
        zebra_vxlan_init();
        zebra_mlag_init();
+       zebra_neigh_init();
 
        zrouter.rules_hash = hash_create_size(8, zebra_pbr_rules_hash_key,
                                              zebra_pbr_rules_hash_equal,
@@ -304,6 +313,20 @@ void zebra_router_init(bool asic_offload, bool notify_on_ack)
                hash_create_size(8, zebra_nhg_id_key, zebra_nhg_hash_id_equal,
                                 "Zebra Router Nexthop Groups ID index");
 
+       zrouter.rules_hash =
+               hash_create_size(8, zebra_pbr_rules_hash_key,
+                                zebra_pbr_rules_hash_equal, "Rules Hash");
+
+       zrouter.qdisc_hash =
+               hash_create_size(8, zebra_tc_qdisc_hash_key,
+                                zebra_tc_qdisc_hash_equal, "TC (qdisc) Hash");
+       zrouter.class_hash = hash_create_size(8, zebra_tc_class_hash_key,
+                                             zebra_tc_class_hash_equal,
+                                             "TC (classes) Hash");
+       zrouter.filter_hash = hash_create_size(8, zebra_tc_filter_hash_key,
+                                              zebra_tc_filter_hash_equal,
+                                              "TC (filter) Hash");
+
        zrouter.asic_offloaded = asic_offload;
        zrouter.notify_on_ack = notify_on_ack;