p->do_stop = 0;
}
- if (proto_is_done(p) && p->pool_fragile) /* perusing pool_fragile to do this once only */
+ if (proto_is_done(p) && p->pool_inloop) /* perusing pool_inloop to do this once only */
{
- rp_free(p->pool_fragile);
- p->pool_fragile = NULL;
+ rp_free(p->pool_inloop);
+ p->pool_inloop = NULL;
if (p->loop != &main_birdloop)
birdloop_stop_self(p->loop, proto_loop_stopped, p);
else
PROTO_LOCKED_FROM_MAIN(p)
{
- p->pool_fragile = rp_newf(p->pool, birdloop_domain(p->loop), "Protocol %s fragile objects", p->cf->name);
+ p->pool_inloop = rp_newf(p->pool, birdloop_domain(p->loop), "Protocol %s early cleanup objects", p->cf->name);
+ p->pool_up = rp_newf(p->pool, birdloop_domain(p->loop), "Protocol %s stop-free objects", p->cf->name);
proto_notify_state(p, (p->proto->start ? p->proto->start(p) : PS_UP));
}
}
p->main_source = NULL;
}
+ rp_free(p->pool_up);
+ p->pool_up = NULL;
+
proto_stop_channels(p);
rt_destroy_sources(&p->sources, p->event);
struct proto_config *cf; /* Configuration data */
struct proto_config *cf_new; /* Configuration we want to switch to after shutdown (NULL=delete) */
pool *pool; /* Pool containing local objects */
- pool *pool_fragile; /* Pool containing fragile local objects which need to be freed
+ pool *pool_up; /* Pool containing local objects which should be dropped as soon
+ as the protocol enters the STOP / DOWN state */
+ pool *pool_inloop; /* Pool containing local objects which need to be freed
before the protocol's birdloop actually stops, like olocks */
event *event; /* Protocol event */
timer *restart_timer; /* Timer to restart the protocol from limits */
* so that we are the only instance attempting to talk with that neighbor.
*/
struct object_lock *lock;
- lock = p->lock = olock_new(P->pool_fragile);
+ lock = p->lock = olock_new(P->pool_inloop);
lock->addr = p->remote_ip;
lock->port = p->cf->remote_port;
lock->iface = p->cf->iface;
p->gr_mode = c->gr_mode;
p->gr_time = c->gr_time;
p->tick = c->tick;
- p->disp_timer = tm_new_init(P->pool, ospf_disp, p, p->tick S, 0);
+ p->disp_timer = tm_new_init(P->pool_up, ospf_disp, p, p->tick S, 0);
tm_start(p->disp_timer, 100 MS);
p->lsab_size = 256;
p->lsab_used = 0;
}
FIB_WALK_END;
- if (tm_active(p->disp_timer))
- tm_stop(p->disp_timer);
-
return PS_DOWN;
}
add_tail(&p->iface_list, NODE ifa);
- ifa->timer = tm_new_init(p->p.pool, rip_iface_timer, ifa, 0, 0);
- ifa->rxmt_timer = tm_new_init(p->p.pool, rip_rxmt_timeout, ifa, 0, 0);
+ ifa->timer = tm_new_init(p->p.pool_up, rip_iface_timer, ifa, 0, 0);
+ ifa->rxmt_timer = tm_new_init(p->p.pool_up, rip_rxmt_timeout, ifa, 0, 0);
struct object_lock *lock = olock_new(p->p.pool);
lock->type = OBJLOCK_UDP;
fib_init(&p->rtable, P->pool, cf->rip2 ? NET_IP4 : NET_IP6,
sizeof(struct rip_entry), OFFSETOF(struct rip_entry, n), 0, NULL);
p->rte_slab = sl_new(P->pool, sizeof(struct rip_rte));
- p->timer = tm_new_init(P->pool, rip_timer, p, 0, 0);
+ p->timer = tm_new_init(P->pool_up, rip_timer, p, 0, 0);
p->rip2 = cf->rip2;
p->ecmp = cf->ecmp;