From c8dde10f58213f2011f074fcd627f4c5f463b013 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Wed, 16 May 2018 21:07:54 +0000 Subject: *: remove -r from daemons except zebra This option is only implemented by 4 daemons: - BGPD - RIPD - RIPNGD - Zebra Manpages and documentation say that the option causes routes to not be uninstalled from zebra when the daemon terminates. This is true for RIPD and RIPNGD. This is not true for BGPD; in that daemon it only prevents transmission of Cease / Peer Unconfig NOTIFICATION messages to peers. Moreover, when any daemon disconnects from Zebra, all of its routes are uninstalled from Zebra and the kernel regardless of this option, rendering the option largely vestigial. It is still useful in Zebra, where it prevents all routes from being uninstalled when Zebra shuts down, so it is left there. Signed-off-by: Quentin Young --- ripngd/ripng_main.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'ripngd') diff --git a/ripngd/ripng_main.c b/ripngd/ripng_main.c index 8ef27daab..e4501d6f8 100644 --- a/ripngd/ripng_main.c +++ b/ripngd/ripng_main.c @@ -40,6 +40,9 @@ #include "ripngd/ripngd.h" /* RIPngd options. */ +#if CONFDATE > 20190521 + CPP_NOTICE("-r / --retain has reached deprecation EOL, remove") +#endif struct option longopts[] = {{"retain", no_argument, NULL, 'r'}, {0}}; /* ripngd privileges */ @@ -60,11 +63,6 @@ struct zebra_privs_t ripngd_privs = { .cap_num_i = 0}; -/* RIPngd program name */ - -/* Route retain mode flag. */ -int retain_mode = 0; - /* Master of threads. */ struct thread_master *master; @@ -88,8 +86,7 @@ static void sigint(void) { zlog_notice("Terminating on signal"); - if (!retain_mode) - ripng_clean(); + ripng_clean(); ripng_zebra_stop(); frr_fini(); @@ -130,28 +127,36 @@ FRR_DAEMON_INFO(ripngd, RIPNG, .vty_port = RIPNG_VTY_PORT, .privs = &ripngd_privs, ) +#if CONFDATE > 20190521 +CPP_NOTICE("-r / --retain has reached deprecation EOL, remove") +#endif +#define DEPRECATED_OPTIONS "r" + /* RIPngd main routine. */ int main(int argc, char **argv) { frr_preinit(&ripngd_di, argc, argv); - frr_opt_add( - "r", longopts, - " -r, --retain When program terminates, retain added route by ripd.\n"); + + frr_opt_add("" DEPRECATED_OPTIONS, longopts, ""); while (1) { int opt; opt = frr_getopt(argc, argv, NULL); + if (opt && opt < 128 && strchr(DEPRECATED_OPTIONS, opt)) { + fprintf(stderr, + "The -%c option no longer exists.\nPlease refer to the manual.\n", + opt); + continue; + } + if (opt == EOF) break; switch (opt) { case 0: break; - case 'r': - retain_mode = 1; - break; default: frr_help_exit(1); break; -- cgit v1.2.3