diff options
Diffstat (limited to 'ospfd/ospf_zebra.c')
| -rw-r--r-- | ospfd/ospf_zebra.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c index c6b0955dab..ec8f1ee852 100644 --- a/ospfd/ospf_zebra.c +++ b/ospfd/ospf_zebra.c @@ -51,6 +51,9 @@ #include "ospfd/ospf_zebra.h" #include "ospfd/ospf_te.h" +DEFINE_MTYPE_STATIC(OSPFD, OSPF_EXTERNAL, "OSPF External route table") +DEFINE_MTYPE_STATIC(OSPFD, OSPF_REDISTRIBUTE, "OSPF Redistriute") + DEFINE_HOOK(ospf_if_update, (struct interface * ifp), (ifp)) DEFINE_HOOK(ospf_if_delete, (struct interface * ifp), (ifp)) @@ -628,7 +631,8 @@ struct ospf_external *ospf_external_add(u_char type, u_short instance) om->external[type] = list_new(); ext_list = om->external[type]; - ext = (struct ospf_external *)calloc(1, sizeof(struct ospf_external)); + ext = (struct ospf_external *)XCALLOC(MTYPE_OSPF_EXTERNAL, + sizeof(struct ospf_external)); ext->instance = instance; EXTERNAL_INFO(ext) = route_table_init(); @@ -652,6 +656,7 @@ void ospf_external_del(u_char type, u_short instance) list_free(om->external[type]); om->external[type] = NULL; } + XFREE(MTYPE_OSPF_EXTERNAL, ext); } } @@ -687,7 +692,8 @@ struct ospf_redist *ospf_redist_add(struct ospf *ospf, u_char type, ospf->redist[type] = list_new(); red_list = ospf->redist[type]; - red = (struct ospf_redist *)calloc(1, sizeof(struct ospf_redist)); + red = (struct ospf_redist *)XCALLOC(MTYPE_OSPF_REDISTRIBUTE, + sizeof(struct ospf_redist)); red->instance = instance; red->dmetric.type = -1; red->dmetric.value = -1; @@ -709,6 +715,7 @@ void ospf_redist_del(struct ospf *ospf, u_char type, u_short instance) list_free(ospf->redist[type]); ospf->redist[type] = NULL; } + XFREE(MTYPE_OSPF_REDISTRIBUTE, red); } } |
