diff options
Diffstat (limited to 'conf')
-rw-r--r-- | conf/conf.c | 21 | ||||
-rw-r--r-- | conf/conf.h | 7 | ||||
-rw-r--r-- | conf/confbase.Y | 6 |
3 files changed, 26 insertions, 8 deletions
diff --git a/conf/conf.c b/conf/conf.c index fefcac5..eeffd4a 100644 --- a/conf/conf.c +++ b/conf/conf.c @@ -175,6 +175,12 @@ global_commit(struct config *new, struct config *old) { if (!old) return 0; + + if (!ipa_equal(old->listen_bgp_addr, new->listen_bgp_addr) || + (old->listen_bgp_port != new->listen_bgp_port) || + (old->listen_bgp_flags != new->listen_bgp_flags)) + log(L_WARN "Reconfiguration of BGP listening socket not implemented, please restart BIRD."); + if (!new->router_id) new->router_id = old->router_id; if (new->router_id != old->router_id) @@ -183,7 +189,7 @@ global_commit(struct config *new, struct config *old) } static int -config_do_commit(struct config *c) +config_do_commit(struct config *c, int type) { int force_restart, nobs; @@ -199,7 +205,7 @@ config_do_commit(struct config *c) DBG("rt_commit\n"); rt_commit(c, old_config); DBG("protos_commit\n"); - protos_commit(c, old_config, force_restart); + protos_commit(c, old_config, force_restart, type); new_config = NULL; /* Just to be sure nobody uses that now */ if (old_config) nobs = --old_config->obstacle_count; @@ -230,7 +236,7 @@ config_done(void *unused UNUSED) c = future_config; future_config = NULL; log(L_INFO "Switching to queued configuration..."); - if (!config_do_commit(c)) + if (!config_do_commit(c, RECONFIG_HARD)) break; } } @@ -238,6 +244,7 @@ config_done(void *unused UNUSED) /** * config_commit - commit a configuration * @c: new configuration + * @type: type of reconfiguration (RECONFIG_SOFT or RECONFIG_HARD) * * When a configuration is parsed and prepared for use, the * config_commit() function starts the process of reconfiguration. @@ -257,11 +264,11 @@ config_done(void *unused UNUSED) * are accepted. */ int -config_commit(struct config *c) +config_commit(struct config *c, int type) { if (!config) /* First-time configuration */ { - config_do_commit(c); + config_do_commit(c, RECONFIG_HARD); return CONF_DONE; } if (old_config) /* Reconfiguration already in progress */ @@ -282,7 +289,7 @@ config_commit(struct config *c) future_config = c; return CONF_QUEUED; } - if (config_do_commit(c)) + if (config_do_commit(c, type)) { config_done(NULL); return CONF_DONE; @@ -315,7 +322,7 @@ order_shutdown(void) init_list(&c->tables); c->shutdown = 1; shutting_down = 1; - config_commit(c); + config_commit(c, RECONFIG_HARD); shutting_down = 2; } diff --git a/conf/conf.h b/conf/conf.h index 17b975b..951dde3 100644 --- a/conf/conf.h +++ b/conf/conf.h @@ -22,6 +22,9 @@ struct config { list logfiles; /* Configured log fils (sysdep) */ struct rtable_config *master_rtc; /* Configuration of master routing table */ u32 router_id; /* Our Router ID */ + ip_addr listen_bgp_addr; /* Listening BGP socket should use this address */ + unsigned listen_bgp_port; /* Listening BGP socket should use this port (0 is default) */ + u32 listen_bgp_flags; /* Listening BGP socket should use these flags */ unsigned int proto_default_debug; /* Default protocol debug mask */ int cli_debug; /* Tracing of CLI connections and commands */ char *err_msg; /* Parser error message */ @@ -47,7 +50,9 @@ struct config *config_alloc(byte *name); int config_parse(struct config *); int cli_parse(struct config *); void config_free(struct config *); -int config_commit(struct config *); +int config_commit(struct config *, int type); +#define RECONFIG_HARD 0 +#define RECONFIG_SOFT 1 void cf_error(char *msg, ...) NORET; void config_add_obstacle(struct config *); void config_del_obstacle(struct config *); diff --git a/conf/confbase.Y b/conf/confbase.Y index 4385462..a2df85d 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -57,6 +57,7 @@ CF_DECLS %type <time> datetime %type <a> ipa %type <px> prefix prefix_or_ipa +%type <t> text_or_none %nonassoc PREFIX_DUMMY %nonassoc '=' '<' '>' '~' '.' GEQ LEQ NEQ AND OR PO PC @@ -153,6 +154,11 @@ datetime: } ; +text_or_none: + TEXT { $$ = $1; } + | { $$ = NULL; } + ; + CF_CODE CF_END |