]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Give Nexthop Group Hash entries a defined memory type
authorStephen Worley <sworley@cumulusnetworks.com>
Fri, 15 Mar 2019 16:23:51 +0000 (12:23 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Fri, 25 Oct 2019 15:13:38 +0000 (11:13 -0400)
The nexthop group hash entries were using the "TMP" memory
type. Declared one for them and updated to use it.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
zebra/zebra_nhg.c

index 7800ecd2598c2f084d8620e90acd0c26b661a739..2da007fb04773c8548fbeb3e8025925b0688fc6a 100644 (file)
@@ -27,6 +27,7 @@
 #include "lib/routemap.h"
 #include "lib/mpls.h"
 #include "lib/jhash.h"
+#include "lib/debug.h"
 
 #include "zebra/connected.h"
 #include "zebra/debug.h"
 #include "zebra/zebra_nhg.h"
 #include "zebra/zebra_rnh.h"
 #include "zebra/zebra_routemap.h"
+#include "zebra/zebra_memory.h"
+#include "zebra/zserv.h"
 #include "zebra/rt.h"
 #include "zebra_errors.h"
 
+DEFINE_MTYPE_STATIC(ZEBRA, NHG, "Nexthop Group Entry");
 /**
  * zebra_nhg_lookup_id() - Lookup the nexthop group id in the id table
  *
@@ -84,7 +88,7 @@ static void *zebra_nhg_alloc(void *arg)
        struct nhg_hash_entry *nhe;
        struct nhg_hash_entry *copy = arg;
 
-       nhe = XCALLOC(MTYPE_TMP, sizeof(struct nhg_hash_entry));
+       nhe = XCALLOC(MTYPE_NHG, sizeof(struct nhg_hash_entry));
 
        pthread_mutex_lock(&lock); /* Lock, set the id counter from kernel */
        if (copy->id) {
@@ -277,7 +281,8 @@ void zebra_nhg_free(void *arg)
        nhe = (struct nhg_hash_entry *)arg;
 
        nexthops_free(nhe->nhg.nexthop);
-       XFREE(MTYPE_TMP, nhe);
+
+       XFREE(MTYPE_NHG, nhe);
 }
 
 /**