Commit 53958809 authored by Maria Matejka's avatar Maria Matejka
Browse files

Fixed pipe reload/refeed

parent 821344c7
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);
+3 −0
Original line number Diff line number Diff line
@@ -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;

+19 −0
Original line number Diff line number Diff line
@@ -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;