summaryrefslogtreecommitdiff
path: root/ospfd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-08-21 09:29:30 -0400
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-09-06 20:50:58 +0000
commit14c5ef90b7489eba0b490f923ed9e06630f843c5 (patch)
tree232502c862cac2290e57604a8fc4d6ff0e69fca3 /ospfd
parented59abd5c77cf8f32898f97bbdea3c95aadaea11 (diff)
ospf_nsm.c: Convert warn->err and use error-code
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_errors.c6
-rw-r--r--ospfd/ospf_errors.h1
-rw-r--r--ospfd/ospf_nsm.c19
3 files changed, 17 insertions, 9 deletions
diff --git a/ospfd/ospf_errors.c b/ospfd/ospf_errors.c
index b3673a7f76..4646ed33b9 100644
--- a/ospfd/ospf_errors.c
+++ b/ospfd/ospf_errors.c
@@ -164,6 +164,12 @@ static struct log_ref ferr_ospf_err[] = {
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
},
{
+ .code = OSPF_ERR_FSM_INVALID_STATE,
+ .title = "OSPF FSM invalid state detected",
+ .description = "OSPF has attempted to change states when it should not be able to",
+ .suggestion = "Gather log files and open an issue",
+ },
+ {
.code = END_FERR,
}
};
diff --git a/ospfd/ospf_errors.h b/ospfd/ospf_errors.h
index f0e9e3da93..664f6f1bd4 100644
--- a/ospfd/ospf_errors.h
+++ b/ospfd/ospf_errors.h
@@ -32,6 +32,7 @@ enum ospf_log_refs {
OSPF_ERR_SR_NODE_CREATE,
OSPF_ERR_SR_INVALID_LSA_ID,
OSPF_ERR_INVALID_ALGORITHM,
+ OSPF_ERR_FSM_INVALID_STATE,
OSPF_WARN_SET_METRIC_PLUS,
OSPF_WARN_MD5,
OSPF_WARN_PACKET,
diff --git a/ospfd/ospf_nsm.c b/ospfd/ospf_nsm.c
index 1e72e3db63..83183071c7 100644
--- a/ospfd/ospf_nsm.c
+++ b/ospfd/ospf_nsm.c
@@ -48,6 +48,7 @@
#include "ospfd/ospf_flood.h"
#include "ospfd/ospf_abr.h"
#include "ospfd/ospf_bfd.h"
+#include "ospfd/ospf_errors.h"
DEFINE_HOOK(ospf_nsm_change,
(struct ospf_neighbor * on, int state, int oldstate),
@@ -795,15 +796,15 @@ int ospf_nsm_event(struct thread *thread)
* not
* try set next_state.
*/
- zlog_warn(
- "NSM[%s:%s]: %s (%s): "
- "Warning: action tried to change next_state to %s",
- IF_NAME(nbr->oi), inet_ntoa(nbr->router_id),
- lookup_msg(ospf_nsm_state_msg, nbr->state,
- NULL),
- ospf_nsm_event_str[event],
- lookup_msg(ospf_nsm_state_msg, func_state,
- NULL));
+ flog_err(OSPF_ERR_FSM_INVALID_STATE,
+ "NSM[%s:%s]: %s (%s): "
+ "Warning: action tried to change next_state to %s",
+ IF_NAME(nbr->oi), inet_ntoa(nbr->router_id),
+ lookup_msg(ospf_nsm_state_msg, nbr->state,
+ NULL),
+ ospf_nsm_event_str[event],
+ lookup_msg(ospf_nsm_state_msg, func_state,
+ NULL));
}
}