diff options
| author | Russ White <russ@riw.us> | 2021-03-23 10:07:28 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-23 10:07:28 -0400 |
| commit | 63d4a9708cad8dadd9ba0f1b104072862fc41c98 (patch) | |
| tree | ec77133952bdb98e76fc15249dd2ca3eb63b848e /zebra/zebra_rib.c | |
| parent | 38981e4bbae90aa854b3c7487075e4a69c55ddc5 (diff) | |
| parent | 224ccf29d9e9d08a6a177d8c994ab5a743b276cf (diff) | |
Merge pull request #8307 from opensourcerouting/mtypes-cleanup-20210322
isisd, eigrpd, pathd: clean up & drop *_memory.[ch] files, make a whole bunch static
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 6b26192711..ffe4be8557 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -49,7 +49,6 @@ #include "zebra/rt.h" #include "zebra/zapi_msg.h" #include "zebra/zebra_errors.h" -#include "zebra/zebra_memory.h" #include "zebra/zebra_ns.h" #include "zebra/zebra_rnh.h" #include "zebra/zebra_routemap.h" @@ -58,6 +57,10 @@ #include "zebra/zapi_msg.h" #include "zebra/zebra_dplane.h" +DEFINE_MGROUP(ZEBRA, "zebra"); + +DEFINE_MTYPE(ZEBRA, RE, "Route Entry"); +DEFINE_MTYPE_STATIC(ZEBRA, RIB_DEST, "RIB destination"); DEFINE_MTYPE_STATIC(ZEBRA, RIB_UPDATE_CTX, "Rib update context object"); /* @@ -800,6 +803,23 @@ int rib_gc_dest(struct route_node *rn) return 1; } +void zebra_rtable_node_cleanup(struct route_table *table, + struct route_node *node) +{ + struct route_entry *re, *next; + + RNODE_FOREACH_RE_SAFE (node, re, next) { + rib_unlink(node, re); + } + + if (node->info) { + rib_dest_t *dest = node->info; + + rnh_list_fini(&dest->nht); + XFREE(MTYPE_RIB_DEST, node->info); + } +} + static void rib_process_add_fib(struct zebra_vrf *zvrf, struct route_node *rn, struct route_entry *new) { @@ -2698,7 +2718,7 @@ void rib_unlink(struct route_node *rn, struct route_entry *re) nexthops_free(re->fib_ng.nexthop); - XFREE(MTYPE_OPAQUE, re->opaque); + zapi_opaque_free(re->opaque); XFREE(MTYPE_RE, re); } |
