diff options
Diffstat (limited to 'proto/mrt')
-rw-r--r-- | proto/mrt/mrt.c | 5 | ||||
-rw-r--r-- | proto/mrt/mrt.h | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/proto/mrt/mrt.c b/proto/mrt/mrt.c index b40592d2..e12f7743 100644 --- a/proto/mrt/mrt.c +++ b/proto/mrt/mrt.c @@ -561,10 +561,11 @@ mrt_rib_table_dump(struct mrt_table_dump_state *s, net *n, int add_path) static struct mrt_table_dump_state * mrt_table_dump_init(pool *pp) { - pool *pool = rp_new(pp, "MRT Table Dump"); + pool *pool = rp_new(pp, &main_birdloop, "MRT Table Dump"); struct mrt_table_dump_state *s = mb_allocz(pool, sizeof(struct mrt_table_dump_state)); s->pool = pool; + s->parent = pp; s->linpool = lp_new(pool, 4080); s->peer_lp = lp_new(pool, 4080); mrt_buffer_init(&s->buf, pool, 2 * MRT_ATTR_BUFFER_SIZE); @@ -601,7 +602,7 @@ mrt_table_dump_free(struct mrt_table_dump_state *s) config_del_obstacle(s->config); - rfree(s->pool); + rp_free(s->pool, s->parent); } diff --git a/proto/mrt/mrt.h b/proto/mrt/mrt.h index 04865089..2e616f6f 100644 --- a/proto/mrt/mrt.h +++ b/proto/mrt/mrt.h @@ -67,6 +67,7 @@ struct mrt_table_dump_state { /* Allocated by mrt_table_dump_init() */ pool *pool; /* Pool for table dump */ + pool *parent; /* Parent pool for cleanup */ linpool *linpool; /* Temporary linear pool */ linpool *peer_lp; /* Linear pool for peer entries in peer_hash */ buffer buf; /* Buffer for MRT messages */ |