Skip to content

Commit 33656d2

Browse files
committed
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 <[email protected]>
1 parent d4644d4 commit 33656d2

File tree

2 files changed

+3
-23
lines changed

2 files changed

+3
-23
lines changed

doc/user/zebra.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ Besides the common invocation options (:ref:`common-invocation-options`), the
2323
Runs in batch mode. *zebra* parses configuration file and terminates
2424
immediately.
2525

26-
.. option:: -k, --keep_kernel
27-
28-
When zebra starts up, don't delete old self inserted routes.
29-
3026
.. option:: -K TIME, --graceful_restart TIME
3127

3228
If this option is specified, the graceful restart time is TIME seconds.

zebra/main.c

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ int retain_mode = 0;
7474
/* Allow non-quagga entities to delete quagga routes */
7575
int allow_delete = 0;
7676

77-
/* Don't delete kernel route. */
78-
int keep_kernel_mode = 0;
79-
8077
int graceful_restart;
8178

8279
bool v6_rr_semantics = false;
@@ -272,7 +269,7 @@ int main(int argc, char **argv)
272269
frr_preinit(&zebra_di, argc, argv);
273270

274271
frr_opt_add(
275-
"bakz:e:l:o:rK:"
272+
"baz:e:l:o:rK:"
276273
#ifdef HAVE_NETLINK
277274
"s:n"
278275
#endif
@@ -289,7 +286,6 @@ int main(int argc, char **argv)
289286
" -z, --socket Set path of zebra socket\n"
290287
" -e, --ecmp Specify ECMP to use.\n"
291288
" -l, --label_socket Socket to external label manager\n"
292-
" -k, --keep_kernel Don't delete old routes which were installed by zebra.\n"
293289
" -r, --retain When program terminates, retain added route by zebra.\n"
294290
" -o, --vrfdefaultname Set default VRF name.\n"
295291
" -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)
321317
case 'a':
322318
allow_delete = 1;
323319
break;
324-
case 'k':
325-
if (graceful_restart) {
326-
zlog_err("Graceful Restart initiated, we cannot keep the existing kernel routes");
327-
return 1;
328-
}
329-
keep_kernel_mode = 1;
330-
break;
331320
case 'e':
332321
zrouter.multipath_num = atoi(optarg);
333322
if (zrouter.multipath_num > MULTIPATH_NUM
@@ -358,10 +347,6 @@ int main(int argc, char **argv)
358347
retain_mode = 1;
359348
break;
360349
case 'K':
361-
if (keep_kernel_mode) {
362-
zlog_err("Keep Kernel mode specified, graceful restart incompatible");
363-
return 1;
364-
}
365350
graceful_restart = atoi(optarg);
366351
break;
367352
#ifdef HAVE_NETLINK
@@ -452,9 +437,8 @@ int main(int argc, char **argv)
452437
* we have to have route_read() called before.
453438
*/
454439
zrouter.startup_time = monotime(NULL);
455-
if (!keep_kernel_mode)
456-
thread_add_timer(zrouter.master, rib_sweep_route,
457-
NULL, graceful_restart, NULL);
440+
thread_add_timer(zrouter.master, rib_sweep_route,
441+
NULL, graceful_restart, NULL);
458442

459443
/* Needed for BSD routing socket. */
460444
pid = getpid();

0 commit comments

Comments
 (0)