summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2023-03-08 13:44:18 +0100
committerMaria Matejka <mq@ucw.cz>2023-04-04 17:00:58 +0200
commit90de93ca0336b95038dddaef276d0c7ae5b7bbff (patch)
tree82dfda0d44cb5b84fa46762c0bf0104859a84b16 /nest
parent97d2875e999487bfe91f16c77c409ac0080541d3 (diff)
Fixed unwanted reloads while reconfiguring protocols with import table on
Diffstat (limited to 'nest')
-rw-r--r--nest/proto.c9
-rw-r--r--nest/protocol.h1
2 files changed, 5 insertions, 5 deletions
diff --git a/nest/proto.c b/nest/proto.c
index 6c6d4ed3..3a8c938e 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -690,7 +690,7 @@ channel_reload_dump_req(struct rt_export_request *req)
void channel_reload_export_bulk(struct rt_export_request *req, const net_addr *net, struct rt_pending_export *rpe, rte **feed, uint count);
/* Called by protocol to activate in_table */
-void
+static void
channel_setup_in_table(struct channel *c)
{
c->reload_req = (struct rt_export_request) {
@@ -701,8 +701,6 @@ channel_setup_in_table(struct channel *c)
.dump_req = channel_reload_dump_req,
.log_state_change = channel_reload_log_state_change,
};
-
- c->in_keep |= RIK_PREFILTER;
}
@@ -711,6 +709,9 @@ channel_do_start(struct channel *c)
{
c->proto->active_channels++;
+ if ((c->in_keep & RIK_PREFILTER) == RIK_PREFILTER)
+ channel_setup_in_table(c);
+
CALL(c->channel->start, c);
channel_start_import(c);
@@ -882,7 +883,7 @@ channel_request_reload(struct channel *c)
CD(c, "Reload requested");
- if (c->in_keep & RIK_PREFILTER)
+ if ((c->in_keep & RIK_PREFILTER) == RIK_PREFILTER)
channel_schedule_reload(c);
else
c->proto->reload_routes(c);
diff --git a/nest/protocol.h b/nest/protocol.h
index f9f89c06..fe987d17 100644
--- a/nest/protocol.h
+++ b/nest/protocol.h
@@ -642,7 +642,6 @@ struct channel *proto_add_channel(struct proto *p, struct channel_config *cf);
int proto_configure_channel(struct proto *p, struct channel **c, struct channel_config *cf);
void channel_set_state(struct channel *c, uint state);
-void channel_setup_in_table(struct channel *c);
void channel_schedule_reload(struct channel *c);
static inline void channel_init(struct channel *c) { channel_set_state(c, CS_START); }