From: Stephen Worley Date: Fri, 15 Mar 2019 16:23:51 +0000 (-0400) Subject: zebra: Give Nexthop Group Hash entries a defined memory type X-Git-Tag: base_7.3~219^2~139 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=51d80884482007f380bd12b4494c893cfd813583;p=matthieu%2Ffrr.git zebra: Give Nexthop Group Hash entries a defined memory type 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 --- diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index 7800ecd259..2da007fb04 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -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" @@ -34,9 +35,12 @@ #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); } /**