diff options
Diffstat (limited to 'isisd/isis_main.c')
| -rw-r--r-- | isisd/isis_main.c | 74 |
1 files changed, 58 insertions, 16 deletions
diff --git a/isisd/isis_main.c b/isisd/isis_main.c index 385cdcc350..60ec8cdad4 100644 --- a/isisd/isis_main.c +++ b/isisd/isis_main.c @@ -51,9 +51,16 @@ /* Default configuration file name */ #define ISISD_DEFAULT_CONFIG "isisd.conf" -/* Default vty port */ -#define ISISD_VTY_PORT 2608 -#define FABRICD_VTY_PORT 2618 + +#define FABRICD_STATE_NAME "%s/fabricd.json", frr_libstatedir +#define ISISD_STATE_NAME "%s/isisd.json", frr_libstatedir + +/* The typo was there before. Do not fix it! The point is to load mis-saved + * state files from older versions. + * + * Also fabricd was using the same file. Sigh. + */ +#define ISISD_COMPAT_STATE_NAME "%s/isid-restart.json", frr_runstatedir /* isisd privileges */ zebra_capabilities_t _caps_p[] = {ZCAP_NET_RAW, ZCAP_BIND, ZCAP_SYS_ADMIN}; @@ -93,6 +100,7 @@ static __attribute__((__noreturn__)) void terminate(int i) { isis_terminate(); isis_sr_term(); + isis_srv6_term(); isis_zebra_stop(); exit(i); } @@ -170,6 +178,9 @@ static const struct frr_yang_module_info *const isisd_yang_modules[] = { /* clang-format on */ +/* Max wait time for config to load before generating LSPs */ +#define ISIS_PRE_CONFIG_MAX_WAIT_SECONDS 600 + static void isis_config_finish(struct event *t) { struct listnode *node, *inode; @@ -182,12 +193,17 @@ static void isis_config_finish(struct event *t) } } +static void isis_config_end_timeout(struct event *t) +{ + zlog_err("IS-IS configuration end timer expired after %d seconds.", + ISIS_PRE_CONFIG_MAX_WAIT_SECONDS); + isis_config_finish(t); +} + static void isis_config_start(void) { - /* Max wait time for config to load before generating lsp */ -#define ISIS_PRE_CONFIG_MAX_WAIT_SECONDS 600 EVENT_OFF(t_isis_cfg); - event_add_timer(im->master, isis_config_finish, NULL, + event_add_timer(im->master, isis_config_end_timeout, NULL, ISIS_PRE_CONFIG_MAX_WAIT_SECONDS, &t_isis_cfg); } @@ -203,24 +219,41 @@ static void isis_config_end(void) isis_config_finish(t_isis_cfg); } +/* actual paths filled in main() */ +static char state_path[512]; +static char state_compat_path[512]; +static char *state_paths[] = { + state_path, + state_compat_path, + NULL, +}; + +/* clang-format off */ +FRR_DAEMON_INFO( #ifdef FABRICD -FRR_DAEMON_INFO(fabricd, OPEN_FABRIC, .vty_port = FABRICD_VTY_PORT, + fabricd, OPEN_FABRIC, - .proghelp = "Implementation of the OpenFabric routing protocol.", + .vty_port = FABRICD_VTY_PORT, + .proghelp = "Implementation of the OpenFabric routing protocol.", #else -FRR_DAEMON_INFO(isisd, ISIS, .vty_port = ISISD_VTY_PORT, + isisd, ISIS, - .proghelp = "Implementation of the IS-IS routing protocol.", + .vty_port = ISISD_VTY_PORT, + .proghelp = "Implementation of the IS-IS routing protocol.", #endif - .copyright = - "Copyright (c) 2001-2002 Sampo Saaristo, Ofer Wald and Hannes Gredler", + .copyright = "Copyright (c) 2001-2002 Sampo Saaristo, Ofer Wald and Hannes Gredler", + + .signals = isisd_signals, + .n_signals = array_size(isisd_signals), + + .privs = &isisd_privs, - .signals = isisd_signals, - .n_signals = array_size(isisd_signals), + .yang_modules = isisd_yang_modules, + .n_yang_modules = array_size(isisd_yang_modules), - .privs = &isisd_privs, .yang_modules = isisd_yang_modules, - .n_yang_modules = array_size(isisd_yang_modules), + .state_paths = state_paths, ); +/* clang-format on */ /* * Main routine of isisd. Parse arguments and handle IS-IS state machine. @@ -260,6 +293,14 @@ int main(int argc, char **argv, char **envp) } } +#ifdef FABRICD + snprintf(state_path, sizeof(state_path), FABRICD_STATE_NAME); +#else + snprintf(state_path, sizeof(state_path), ISISD_STATE_NAME); +#endif + snprintf(state_compat_path, sizeof(state_compat_path), + ISISD_COMPAT_STATE_NAME); + /* thread master */ isis_master_init(frr_init()); master = im->master; @@ -288,6 +329,7 @@ int main(int argc, char **argv, char **envp) isis_route_map_init(); isis_mpls_te_init(); isis_sr_init(); + isis_srv6_init(); lsp_init(); mt_init(); |
