From 733fb9177f430e1db01397cce29a0345a2dcb881 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 21 Aug 2018 08:14:32 -0400 Subject: [PATCH] ospfd: Modify ospf_abr.c to use new error-code subsystem Signed-off-by: Donald Sharp --- ospfd/ospf_abr.c | 10 +++++++--- ospfd/ospf_errors.c | 6 ++++++ ospfd/ospf_errors.h | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ospfd/ospf_abr.c b/ospfd/ospf_abr.c index 0ff9d0da51..8cd61a4a9d 100644 --- a/ospfd/ospf_abr.c +++ b/ospfd/ospf_abr.c @@ -49,6 +49,7 @@ #include "ospfd/ospf_ase.h" #include "ospfd/ospf_zebra.h" #include "ospfd/ospf_dump.h" +#include "ospfd/ospf_errors.h" static struct ospf_area_range *ospf_area_range_new(struct prefix_ipv4 *p) { @@ -742,7 +743,8 @@ void ospf_abr_announce_network_to_area(struct prefix_ipv4 *p, uint32_t cost, prefix2str((struct prefix *)p, buf, sizeof(buf)); - zlog_warn("%s: Could not refresh %s to %s", + flog_warn(OSPF_WARN_LSA_MISSING, + "%s: Could not refresh %s to %s", __func__, buf, inet_ntoa(area->area_id)); return; @@ -764,7 +766,8 @@ void ospf_abr_announce_network_to_area(struct prefix_ipv4 *p, uint32_t cost, char buf[PREFIX2STR_BUFFER]; prefix2str((struct prefix *)p, buf, sizeof(buf)); - zlog_warn("%s: Could not originate %s to %s", __func__, + flog_warn(OSPF_WARN_LSA_MISSING, + "%s: Could not originate %s to %s", __func__, buf, inet_ntoa(area->area_id)); return; } @@ -1132,7 +1135,8 @@ static void ospf_abr_announce_rtr_to_area(struct prefix_ipv4 *p, uint32_t cost, char buf[PREFIX2STR_BUFFER]; prefix2str((struct prefix *)p, buf, sizeof(buf)); - zlog_warn("%s: Could not refresh/originate %s to %s", + flog_warn(OSPF_WARN_LSA_MISSING, + "%s: Could not refresh/originate %s to %s", __func__, buf, inet_ntoa(area->area_id)); return; } diff --git a/ospfd/ospf_errors.c b/ospfd/ospf_errors.c index 25c211cf60..0eb68755c2 100644 --- a/ospfd/ospf_errors.c +++ b/ospfd/ospf_errors.c @@ -91,6 +91,12 @@ static struct log_ref ferr_ospf_warn[] = { .description = "While processing EXT LSA information, OSPF has noticed that the internal state of OSPF has gotten inconsistent", .suggestion = "Gather data from this machine and it's peer and open an Issue", }, + { + .code = OSPF_WARN_LSA_MISSING, + .title = "OSPF attempted to look up a LSA and it was not found", + .description = "During processing of new LSA information, we attempted to look up an old LSA and it was not found", + .suggestion = "Gather data from this machine and open an Issue", + }, { .code = END_FERR, } diff --git a/ospfd/ospf_errors.h b/ospfd/ospf_errors.h index d6f2eb753c..33fbec8889 100644 --- a/ospfd/ospf_errors.h +++ b/ospfd/ospf_errors.h @@ -43,6 +43,7 @@ enum ospf_log_refs { OSPF_WARN_LSA_INSTALL_FAILURE, OSPF_WARN_LSA_NULL, OSPF_WARN_EXT_LSA_UNEXPECTED, + OSPF_WARN_LSA_MISSING, }; extern void ospf_error_init(void); -- 2.39.5