rfree(c->pool);
}
+/**
+ * config_free_old - free stored old configuration
+ *
+ * This function frees the old configuration (%old_config) that is saved for the
+ * purpose of undo. It is useful before parsing a new config when reconfig is
+ * requested, to avoid keeping three (perhaps memory-heavy) configs together.
+ */
+void
+config_free_old(void)
+{
+ tm_stop(config_timer);
+ undo_available = 0;
+
+ config_free(old_config);
+ old_config = NULL;
+}
+
void
config_add_obstacle(struct config *c)
{
int config_parse(struct config *);
int cli_parse(struct config *);
void config_free(struct config *);
+void config_free_old(void);
int config_commit(struct config *, int type, uint timeout);
int config_confirm(void);
int config_undo(void);
restarted otherwise. Changes in filters usually lead to restart of
affected protocols.
+ The previous configuration is saved and the user can switch back to it
+ with <ref id="cli-configure-undo" name="configure undo"> command. The
+ old saved configuration is released (even if the reconfiguration attempt
+ fails due to e.g. a syntax error).
+
If <cf/soft/ option is used, changes in filters does not cause BIRD to
restart affected protocols, therefore already accepted routes (according
to old filters) would be still propagated, but new routes would be
{
struct config *conf;
+ config_free_old();
+
log(L_INFO "Reconfiguration requested by SIGHUP");
if (!unix_read_config(&conf, config_name))
{
if (cli_access_restricted())
return;
+ config_free_old();
+
struct config *conf = cmd_read_config(name);
if (!conf)
return;