This memory type allocator is used in both bgpd and library part.
to ease identification of the memory type, the allocator is put in
lib folder, instead of zebra folder.

Signed-off-by: Philippe Guibert <philippe.guib...@6wind.com>
---
 bgpd/bgp_nexthop.c | 2 +-
 lib/memtypes.c     | 2 +-
 lib/nexthop.c      | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c
index 479ef949388b..04ee6a0b720b 100644
--- a/bgpd/bgp_nexthop.c
+++ b/bgpd/bgp_nexthop.c
@@ -68,7 +68,7 @@ bnc_nexthop_free (struct bgp_nexthop_cache *bnc)
   for (nexthop = bnc->nexthop; nexthop; nexthop = next)
     {
       next = nexthop->next;
-      XFREE (MTYPE_NEXTHOP, nexthop);
+      XFREE (MTYPE_LIB_NEXTHOP, nexthop);
     }
 }
 
diff --git a/lib/memtypes.c b/lib/memtypes.c
index 8abe99d2a495..632aadc92415 100644
--- a/lib/memtypes.c
+++ b/lib/memtypes.c
@@ -73,6 +73,7 @@ struct memory_list memory_list_lib[] =
   { MTYPE_VRF_NAME,            "VRF name"                      },
   { MTYPE_VRF_BITMAP,          "VRF bit-map"                   },
   { MTYPE_IF_LINK_PARAMS,       "Informational Link Parameters" },
+  { MTYPE_LIB_NEXTHOP,         "Nexthop"                       },
   { -1, NULL },
 };
 
@@ -80,7 +81,6 @@ struct memory_list memory_list_zebra[] =
 {
   { MTYPE_RTADV_PREFIX,                "Router Advertisement Prefix"   },
   { MTYPE_ZEBRA_VRF,           "ZEBRA VRF"                             },
-  { MTYPE_NEXTHOP,             "Nexthop"                       },
   { MTYPE_RIB,                 "RIB"                           },
   { MTYPE_RIB_QUEUE,           "RIB process work queue"        },
   { MTYPE_STATIC_ROUTE,                "Static route"                  },
diff --git a/lib/nexthop.c b/lib/nexthop.c
index 5eb2182de096..1d28c3677f22 100644
--- a/lib/nexthop.c
+++ b/lib/nexthop.c
@@ -102,7 +102,7 @@ nexthop_type_to_str (enum nexthop_types_t nh_type)
 struct nexthop *
 nexthop_new (void)
 {
-  return XCALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop));
+  return XCALLOC (MTYPE_LIB_NEXTHOP, sizeof (struct nexthop));
 }
 
 /* Add nexthop to the end of a nexthop list.  */
@@ -151,7 +151,7 @@ nexthop_free (struct nexthop *nexthop)
     XFREE (0, nexthop->ifname);
   if (nexthop->resolved)
     nexthops_free(nexthop->resolved);
-  XFREE (MTYPE_NEXTHOP, nexthop);
+  XFREE (MTYPE_LIB_NEXTHOP, nexthop);
 }
 
 /* Frees a list of nexthops */
-- 
2.1.4


_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to