mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-15 05:42:15 +01:00
Fixed pipe reload/refeed
This commit is contained in:
parent
821344c781
commit
5395880908
@ -589,6 +589,10 @@ channel_export_stopped(struct rt_export_request *req)
|
||||
{
|
||||
c->refeeding = 1;
|
||||
c->refeed_pending = 0;
|
||||
|
||||
bmap_reset(&c->export_map, 1024);
|
||||
bmap_reset(&c->export_reject_map, 1024);
|
||||
|
||||
rt_request_export(c->table, req);
|
||||
return;
|
||||
}
|
||||
@ -621,6 +625,7 @@ channel_feed_end(struct channel *c)
|
||||
(l->count <= l->max))
|
||||
{
|
||||
log(L_INFO "Protocol %s resets route export limit (%u)", c->proto->name, l->max);
|
||||
channel_reset_limit(c, &c->out_limit, PLD_OUT);
|
||||
|
||||
c->refeed_pending = 1;
|
||||
rt_stop_export(req, channel_export_stopped);
|
||||
|
@ -618,6 +618,9 @@ rt_notify_basic(struct channel *c, const net_addr *net, rte *new, rte *old)
|
||||
if (old && !bmap_test(&c->export_map, old->id))
|
||||
old = NULL;
|
||||
|
||||
if (old && (old->sender == c->in_req.hook))
|
||||
bug("bad-behaved pipe");
|
||||
|
||||
if (!new && !old)
|
||||
return;
|
||||
|
||||
|
@ -108,6 +108,23 @@ pipe_reload_routes(struct channel *C)
|
||||
channel_request_feeding((C == p->pri) ? p->sec : p->pri);
|
||||
}
|
||||
|
||||
static void
|
||||
pipe_feed_begin(struct channel *C, int refeeding UNUSED)
|
||||
{
|
||||
struct pipe_proto *p = (void *) C->proto;
|
||||
struct channel *dst = (C == p->pri) ? p->sec : p->pri;
|
||||
|
||||
channel_refresh_begin(dst);
|
||||
}
|
||||
|
||||
static void
|
||||
pipe_feed_end(struct channel *C)
|
||||
{
|
||||
struct pipe_proto *p = (void *) C->proto;
|
||||
struct channel *dst = (C == p->pri) ? p->sec : p->pri;
|
||||
|
||||
channel_refresh_end(dst);
|
||||
}
|
||||
|
||||
static void
|
||||
pipe_postconfig(struct proto_config *CF)
|
||||
@ -178,6 +195,8 @@ pipe_init(struct proto_config *CF)
|
||||
P->rt_notify = pipe_rt_notify;
|
||||
P->preexport = pipe_preexport;
|
||||
P->reload_routes = pipe_reload_routes;
|
||||
P->feed_begin = pipe_feed_begin;
|
||||
P->feed_end = pipe_feed_end;
|
||||
|
||||
p->rl_gen = (struct tbf) TBF_DEFAULT_LOG_LIMITS;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user