]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixed pipe reload/refeed
authorMaria Matejka <mq@jmq.cz>
Tue, 23 Nov 2021 12:06:27 +0000 (12:06 +0000)
committerMaria Matejka <mq@jmq.cz>
Tue, 23 Nov 2021 12:06:27 +0000 (12:06 +0000)
nest/proto.c
nest/rt-table.c
proto/pipe/pipe.c

index 7a09ed642ce0fb980049b5d0c962b7fbdfdd7915..2d30e640b2f5325b4592f60548511ffd3d2701d2 100644 (file)
@@ -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);
index c53fd195bf6dd4b66d31a1232fbc5d784609ed25..e4c85fd490f99f2cd482c58b059028876e086e8c 100644 (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))
     old = NULL;
 
+  if (old && (old->sender == c->in_req.hook))
+    bug("bad-behaved pipe");
+
   if (!new && !old)
     return;
 
index a30da0e25d6629f63be2062cf53b2d98b0e24725..270f7b9267efb4d8e15a7b637226e5d52afb447c 100644 (file)
@@ -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;