Before starting the graceful restart procedures, ospf_gr_prepare()
verifies for each configured OSPF instance whether it has the opaque
capability enabled (a pre-requisite for GR). If not, a warning is
emitted and GR isn't performed on that instance.
This PR introduces an additional opaque capability check that will
return a CLI error when the opaque capability isn't enabled. The
idea is to make it easier for the user to identify when the GR
activation has failed, instead of requiring him or her to check
the logs for errors.
The original opaque capability check from ospf_gr_prepare() was
retaining as it's possible that that function might be called from
other contexts in the future.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
IP_STR
"Prepare to restart the OSPF process")
{
+ struct ospf *ospf;
+ struct listnode *node;
+
+ for (ALL_LIST_ELEMENTS_RO(om->ospf, node, ospf)) {
+ if (!CHECK_FLAG(ospf->config, OSPF_OPAQUE_CAPABLE)) {
+ vty_out(vty,
+ "%% Can't start graceful restart: opaque capability not enabled (VRF %s)\n\n",
+ ospf_get_name(ospf));
+ return CMD_WARNING;
+ }
+ }
+
ospf_gr_prepare();
return CMD_SUCCESS;