0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 01:31:55 +00:00

Config: Removed obsolete force_restart option when commiting

This commit is contained in:
Maria Matejka 2024-06-13 15:36:18 +02:00
parent ea996d8403
commit 397eee5a00
6 changed files with 15 additions and 24 deletions

View File

@ -243,11 +243,11 @@ config_del_obstacle(struct config *c)
ev_send_loop(&main_birdloop, &c->done_event);
}
static int
static void
global_commit(struct config *new, struct config *old)
{
if (!old)
return 0;
return;
if (!new->router_id)
{
@ -262,8 +262,6 @@ global_commit(struct config *new, struct config *old)
new->router_id = id;
}
}
return 0;
}
static int
@ -299,14 +297,14 @@ config_do_commit(struct config *c, int type)
DBG("filter_commit\n");
filter_commit(c, old_config);
DBG("sysdep_commit\n");
int force_restart = sysdep_commit(c, old_config);
sysdep_commit(c, old_config);
DBG("global_commit\n");
force_restart |= global_commit(c, old_config);
global_commit(c, old_config);
mpls_commit(c, old_config);
DBG("rt_commit\n");
rt_commit(c, old_config);
DBG("protos_commit\n");
protos_commit(c, old_config, force_restart, type);
protos_commit(c, old_config, type);
int obs = old_config ?
atomic_fetch_sub_explicit(&old_config->obstacle_count, 1, memory_order_acq_rel) - 1
: 0;

View File

@ -281,7 +281,7 @@ int cf_parse(void);
/* Sysdep hooks */
void sysdep_preconfig(struct config *);
int sysdep_commit(struct config *, struct config *);
void sysdep_commit(struct config *, struct config *);
void sysdep_shutdown_done(void);
#endif

View File

@ -1456,20 +1456,17 @@ static struct protos_commit_request {
struct config *new;
struct config *old;
enum protocol_startup phase;
int force_reconfig;
int type;
} protos_commit_request;
static int proto_rethink_goal_pending = 0;
static void protos_do_commit(struct config *new, struct config *old, int force_reconfig, int type);
static void protos_do_commit(struct config *new, struct config *old, int type);
/**
* protos_commit - commit new protocol configuration
* @new: new configuration
* @old: old configuration or %NULL if it's boot time config
* @force_reconfig: force restart of all protocols (used for example
* when the router ID changes)
* @type: type of reconfiguration (RECONFIG_SOFT or RECONFIG_HARD)
*
* Scan differences between @old and @new configuration and adjust all
@ -1493,21 +1490,20 @@ static void protos_do_commit(struct config *new, struct config *old, int force_r
* configuration after the shutdown is completed.
*/
void
protos_commit(struct config *new, struct config *old, int force_reconfig, int type)
protos_commit(struct config *new, struct config *old, int type)
{
protos_commit_request = (struct protos_commit_request) {
.new = new,
.old = old,
.phase = (new->shutdown && !new->gr_down) ? PROTOCOL_STARTUP_REGULAR : PROTOCOL_STARTUP_NECESSARY,
.force_reconfig = force_reconfig,
.type = type,
};
protos_do_commit(new, old, force_reconfig, type);
protos_do_commit(new, old, type);
}
static void
protos_do_commit(struct config *new, struct config *old, int force_reconfig, int type)
protos_do_commit(struct config *new, struct config *old, int type)
{
enum protocol_startup phase = protos_commit_request.phase;
struct proto_config *oc, *nc;
@ -1558,7 +1554,7 @@ protos_do_commit(struct config *new, struct config *old, int force_reconfig, int
nc->proto = p;
/* We will try to reconfigure protocol p */
if (!force_reconfig && proto_reconfigure(p, oc, nc, type))
if (proto_reconfigure(p, oc, nc, type))
{
PROTO_LEAVE_FROM_MAIN(proto_loop);
continue;
@ -1643,7 +1639,7 @@ protos_do_commit(struct config *new, struct config *old, int force_reconfig, int
/* If something is pending, the next round will be called asynchronously from proto_rethink_goal(). */
if (!proto_rethink_goal_pending)
protos_do_commit(new, old, force_reconfig, type);
protos_do_commit(new, old, type);
}
static void
@ -1701,7 +1697,6 @@ done:
protos_do_commit(
protos_commit_request.new,
protos_commit_request.old,
protos_commit_request.force_reconfig,
protos_commit_request.type
);
}

View File

@ -76,7 +76,7 @@ struct protocol {
void protos_build(void); /* Called from sysdep to initialize protocols */
void proto_build(struct protocol *); /* Called from protocol to register itself */
void protos_preconfig(struct config *);
void protos_commit(struct config *new, struct config *old, int force_restart, int type);
void protos_commit(struct config *new, struct config *old, int type);
struct proto * proto_spawn(struct proto_config *cf, uint disabled);
void protos_dump_all(void);

View File

@ -200,14 +200,13 @@ sysdep_preconfig(struct config *c)
#endif
}
int
void
sysdep_commit(struct config *new, struct config *old)
{
if (!new->shutdown)
log_switch(0, &new->logfiles, new->syslog_name);
bird_thread_commit(new, old);
return 0;
}
static int

View File

@ -559,10 +559,9 @@ void cmd_reconfig_undo_notify(void) {}
void sysdep_preconfig(struct config *c UNUSED) {}
void bird_thread_commit(struct config *new, struct config *old);
int sysdep_commit(struct config *new, struct config *old)
void sysdep_commit(struct config *new, struct config *old)
{
bird_thread_commit(new, old);
return 0;
}
void sysdep_shutdown_done(void) {}