From 33656d2db287fd293be0cfc59885e2b8ebc2ecad Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 11 May 2019 03:50:11 -0400 Subject: [PATCH] doc, zebra: Remove `keep_kernel_mode` from zebra This code doees this: a) Imagine ospf installs a route into zebra. Zebra crashes and we restart FRR. If we are using the -k option on zebra than all routes are re-read in, including this OSPF route. b) Now imagine at the same time that zebra is starting backup ospf on a different router looses a link to the this route. c) Since zebra was run with -k this OSPF route is read back in but never replaced and we now have a route pointing out an interface to other routers that cannot handle it. We should never allow users to implement bad options from zebra's perspective that allow them to put themselves into a clear problem state and additionally we have *absolutely* no mechanism to ever fix that broken route without special human interaction. Signed-off-by: Donald Sharp --- doc/user/zebra.rst | 4 ---- zebra/main.c | 22 +++------------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/doc/user/zebra.rst b/doc/user/zebra.rst index 59fcad4cd9..40d8949297 100644 --- a/doc/user/zebra.rst +++ b/doc/user/zebra.rst @@ -23,10 +23,6 @@ Besides the common invocation options (:ref:`common-invocation-options`), the Runs in batch mode. *zebra* parses configuration file and terminates immediately. -.. option:: -k, --keep_kernel - - When zebra starts up, don't delete old self inserted routes. - .. option:: -K TIME, --graceful_restart TIME If this option is specified, the graceful restart time is TIME seconds. diff --git a/zebra/main.c b/zebra/main.c index af1f6084b3..5797a5846a 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -74,9 +74,6 @@ int retain_mode = 0; /* Allow non-quagga entities to delete quagga routes */ int allow_delete = 0; -/* Don't delete kernel route. */ -int keep_kernel_mode = 0; - int graceful_restart; bool v6_rr_semantics = false; @@ -272,7 +269,7 @@ int main(int argc, char **argv) frr_preinit(&zebra_di, argc, argv); frr_opt_add( - "bakz:e:l:o:rK:" + "baz:e:l:o:rK:" #ifdef HAVE_NETLINK "s:n" #endif @@ -289,7 +286,6 @@ int main(int argc, char **argv) " -z, --socket Set path of zebra socket\n" " -e, --ecmp Specify ECMP to use.\n" " -l, --label_socket Socket to external label manager\n" - " -k, --keep_kernel Don't delete old routes which were installed by zebra.\n" " -r, --retain When program terminates, retain added route by zebra.\n" " -o, --vrfdefaultname Set default VRF name.\n" " -K, --graceful_restart Graceful restart at the kernel level, timer in seconds for expiration\n" @@ -321,13 +317,6 @@ int main(int argc, char **argv) case 'a': allow_delete = 1; break; - case 'k': - if (graceful_restart) { - zlog_err("Graceful Restart initiated, we cannot keep the existing kernel routes"); - return 1; - } - keep_kernel_mode = 1; - break; case 'e': zrouter.multipath_num = atoi(optarg); if (zrouter.multipath_num > MULTIPATH_NUM @@ -358,10 +347,6 @@ int main(int argc, char **argv) retain_mode = 1; break; case 'K': - if (keep_kernel_mode) { - zlog_err("Keep Kernel mode specified, graceful restart incompatible"); - return 1; - } graceful_restart = atoi(optarg); break; #ifdef HAVE_NETLINK @@ -452,9 +437,8 @@ int main(int argc, char **argv) * we have to have route_read() called before. */ zrouter.startup_time = monotime(NULL); - if (!keep_kernel_mode) - thread_add_timer(zrouter.master, rib_sweep_route, - NULL, graceful_restart, NULL); + thread_add_timer(zrouter.master, rib_sweep_route, + NULL, graceful_restart, NULL); /* Needed for BSD routing socket. */ pid = getpid(); -- 2.39.5