0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 17:51:53 +00:00

Fixed pipe reload/refeed

This commit is contained in:
Maria Matejka 2021-11-23 12:06:27 +00:00
parent 821344c781
commit 5395880908
3 changed files with 27 additions and 0 deletions

View File

@ -589,6 +589,10 @@ channel_export_stopped(struct rt_export_request *req)
{ {
c->refeeding = 1; c->refeeding = 1;
c->refeed_pending = 0; c->refeed_pending = 0;
bmap_reset(&c->export_map, 1024);
bmap_reset(&c->export_reject_map, 1024);
rt_request_export(c->table, req); rt_request_export(c->table, req);
return; return;
} }
@ -621,6 +625,7 @@ channel_feed_end(struct channel *c)
(l->count <= l->max)) (l->count <= l->max))
{ {
log(L_INFO "Protocol %s resets route export limit (%u)", c->proto->name, 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; c->refeed_pending = 1;
rt_stop_export(req, channel_export_stopped); rt_stop_export(req, channel_export_stopped);

View File

@ -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)) if (old && !bmap_test(&c->export_map, old->id))
old = NULL; old = NULL;
if (old && (old->sender == c->in_req.hook))
bug("bad-behaved pipe");
if (!new && !old) if (!new && !old)
return; return;

View File

@ -108,6 +108,23 @@ pipe_reload_routes(struct channel *C)
channel_request_feeding((C == p->pri) ? p->sec : p->pri); 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 static void
pipe_postconfig(struct proto_config *CF) pipe_postconfig(struct proto_config *CF)
@ -178,6 +195,8 @@ pipe_init(struct proto_config *CF)
P->rt_notify = pipe_rt_notify; P->rt_notify = pipe_rt_notify;
P->preexport = pipe_preexport; P->preexport = pipe_preexport;
P->reload_routes = pipe_reload_routes; 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; p->rl_gen = (struct tbf) TBF_DEFAULT_LOG_LIMITS;