From e220f954de174109f980467ec6a3d02eb0e93814 Mon Sep 17 00:00:00 2001 From: Tore Anderson Date: Wed, 22 Jul 2020 17:32:18 +0200 Subject: [PATCH] tools: do not silently ignore errors when loading config during startup Drop the `-n` (`--noerror`) flag from the `vtysh -b` invocation called by the init script responsible for starting FRR. This ensures that errors in the configuration file is propagated to the administrator, and prevents a node from entering a production network while running an essentially undefined configuration (a behaviour that I can personally attest to has the potential to cause disastrous network outages - documented in more detail in Cumulus Networks CS#12791). Silently ignoring errors also leads to the rather odd behaviour that starting FRR will ostensibly succeed, while reloading it immediately after - without changing the configuration - will fail. This is due to the fact that the `-n` flag is not used while reloading. The use of the `-n` flag appears to have been introduced without any explanation in commit 858aa29c6862ed2390baee53b6fc9f54e65246e2 by @donaldsharp. Looking at the commit message, I suspect that it was not an intentional change. It seems more likely to me that it was just meant to be used during testing and development, but ended up being committed to master by accident. Ticket:CM-28003 Signed-off-by: Tore Anderson --- tools/frr.in | 2 +- tools/frrcommon.sh.in | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/frr.in b/tools/frr.in index 40862aa4c9..b860797d5b 100755 --- a/tools/frr.in +++ b/tools/frr.in @@ -77,7 +77,7 @@ vtysh_b () { # Rember, that all variables have been incremented by 1 in convert_daemon_prios() if [ "$vtysh_enable" = 2 -a -f $C_PATH/frr.conf ]; then - $VTYSH -b -n + $VTYSH -b fi } diff --git a/tools/frrcommon.sh.in b/tools/frrcommon.sh.in index 1203a2fe7a..9a144b2b06 100644 --- a/tools/frrcommon.sh.in +++ b/tools/frrcommon.sh.in @@ -65,9 +65,9 @@ vtysh_b () { [ "$1" = "watchfrr" ] && return 0 [ -r "$C_PATH/frr.conf" ] || return 0 if [ -n "$1" ]; then - "$VTYSH" `echo $nsopt` -b -n -d "$1" + "$VTYSH" `echo $nsopt` -b -d "$1" else - "$VTYSH" `echo $nsopt` -b -n + "$VTYSH" `echo $nsopt` -b fi } -- 2.39.5