]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: Add OSPF_WARN_LSA_INSTALL_FAILURE error code
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 21 Aug 2018 01:18:05 +0000 (21:18 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 6 Sep 2018 20:50:58 +0000 (20:50 +0000)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
ospfd/ospf_apiserver.c
ospfd/ospf_errors.c
ospfd/ospf_errors.h
ospfd/ospf_ext.c
ospfd/ospf_lsa.c
ospfd/ospf_ri.c
ospfd/ospf_te.c

index e37f87db9f803116432f5bc84114907a5f5d42f7..4ae57793dc089f7fc8c683ab67d65842f5ca8988 100644 (file)
@@ -1664,7 +1664,8 @@ int ospf_apiserver_originate1(struct ospf_lsa *lsa)
 
        /* Install this LSA into LSDB. */
        if (ospf_lsa_install(ospf, lsa->oi, lsa) == NULL) {
-               zlog_warn("ospf_apiserver_originate1: ospf_lsa_install failed");
+               flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE,
+                         "ospf_apiserver_originate1: ospf_lsa_install failed");
                return -1;
        }
 
@@ -1775,7 +1776,8 @@ struct ospf_lsa *ospf_apiserver_lsa_refresher(struct ospf_lsa *lsa)
 
        /* Install LSA into LSDB. */
        if (ospf_lsa_install(ospf, new->oi, new) == NULL) {
-               zlog_warn(
+               flog_warn(
+                       OSPF_WARN_LSA_INSTALL_FAILURE,
                        "ospf_apiserver_lsa_refresher: ospf_lsa_install failed");
                ospf_lsa_unlock(&new);
                goto out;
index 2e40df0a8e1f280a850d75c3c7365af4b0d24f69..a597b075dd2ee8faf38c9de1bab000ce4092e389 100644 (file)
@@ -71,7 +71,13 @@ static struct log_ref ferr_ospf_warn[] = {
                .code = OSPF_WARN_TE_UNEXPECTED,
                .title = "OSPF has received TE information that it was not expecting",
                .description = "OSPF has received TE information that it was not expecting during normal processing of data",
-               .suggestion = "Gthat log data from this machine and it's peer and open an Issue",
+               .suggestion = "Gather log data from this machine and it's peer and open an Issue",
+       },
+       {
+               .code = OSPF_WARN_LSA_INSTALL_FAILURE,
+               .title = "OSPF was unable to save the LSA into it's database",
+               .description = "During processing of a new lsa and attempting to save the lsa into the OSPF database, this process failed.",
+               .suggestion = "Gather log data from this machine and open an Issue",
        },
        {
                .code = END_FERR,
index c42d7552d070dbab0abfdbf96cf86f96b6cd5347..721d8e08d3f038e63ccfec2f16136d89c96dcc0a 100644 (file)
@@ -40,6 +40,7 @@ enum ospf_log_refs {
        OSPF_WARN_LSA,
        OSPF_WARN_OPAQUE_REGISTRATION,
        OSPF_WARN_TE_UNEXPECTED,
+       OSPF_WARN_LSA_INSTALL_FAILURE,
 };
 
 extern void ospf_error_init(void);
index 8ddf7db9d10e6698cca2dd67fe1e4441c86ad001..280c9b7868580f52ec74f6380ea5e880ee3557d7 100644 (file)
@@ -1068,7 +1068,8 @@ static int ospf_ext_pref_lsa_originate1(struct ospf_area *area,
 
        /* Install this LSA into LSDB. */
        if (ospf_lsa_install(area->ospf, NULL /*oi */, new) == NULL) {
-               zlog_warn("EXT (%s): ospf_lsa_install() error", __func__);
+               flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE,
+                         "EXT (%s): ospf_lsa_install() error", __func__);
                ospf_lsa_unlock(&new);
                return rc;
        }
@@ -1120,7 +1121,8 @@ static int ospf_ext_link_lsa_originate1(struct ospf_area *area,
 
        /* Install this LSA into LSDB. */
        if (ospf_lsa_install(area->ospf, NULL /*oi */, new) == NULL) {
-               zlog_warn("EXT (%s): ospf_lsa_install() error", __func__);
+               flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE,
+                         "EXT (%s): ospf_lsa_install() error", __func__);
                ospf_lsa_unlock(&new);
                return rc;
        }
@@ -1338,7 +1340,8 @@ static struct ospf_lsa *ospf_ext_pref_lsa_refresh(struct ospf_lsa *lsa)
                top = ospf_lookup_by_vrf_id(VRF_DEFAULT);
 
        if (ospf_lsa_install(top, NULL /*oi */, new) == NULL) {
-               zlog_warn("EXT (%s): ospf_lsa_install() error", __func__);
+               flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE,
+                         "EXT (%s): ospf_lsa_install() error", __func__);
                ospf_lsa_unlock(&new);
                return NULL;
        }
@@ -1410,7 +1413,8 @@ static struct ospf_lsa *ospf_ext_link_lsa_refresh(struct ospf_lsa *lsa)
        /* Install this LSA into LSDB. */
        /* Given "lsa" will be freed in the next function */
        if (ospf_lsa_install(top, NULL /*oi */, new) == NULL) {
-               zlog_warn("EXT (%s): Error installing new LSA", __func__);
+               flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE,
+                         "EXT (%s): Error installing new LSA", __func__);
                ospf_lsa_unlock(&new);
                return NULL;
        }
index c3c720b6784618dd0f9311d8f5722ae36bf77a3f..b2056e59cb53b639d0ddb0c80793bfd13df5bcb4 100644 (file)
@@ -50,7 +50,7 @@
 #include "ospfd/ospf_ase.h"
 #include "ospfd/ospf_zebra.h"
 #include "ospfd/ospf_abr.h"
-
+#include "ospfd/ospf_errors.h"
 
 uint32_t get_metric(uint8_t *metric)
 {
@@ -1817,12 +1817,11 @@ struct ospf_lsa *ospf_translated_nssa_originate(struct ospf *ospf,
        }
 
        if ((new = ospf_lsa_install(ospf, NULL, new)) == NULL) {
-               if (IS_DEBUG_OSPF_NSSA)
-                       zlog_debug(
-                               "ospf_lsa_translated_nssa_originate(): "
-                               "Could not install LSA "
-                               "id %s",
-                               inet_ntoa(type7->data->id));
+               flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE,
+                         "ospf_lsa_translated_nssa_originate(): "
+                         "Could not install LSA "
+                         "id %s",
+                         inet_ntoa(type7->data->id));
                return NULL;
        }
 
@@ -1918,11 +1917,10 @@ struct ospf_lsa *ospf_translated_nssa_refresh(struct ospf *ospf,
        }
 
        if (!(new = ospf_lsa_install(ospf, NULL, new))) {
-               if (IS_DEBUG_OSPF_NSSA)
-                       zlog_debug(
-                               "ospf_translated_nssa_refresh(): Could not install "
-                               "translated LSA, Id %s",
-                               inet_ntoa(type7->data->id));
+               flog_warn(
+                       OSPF_WARN_LSA_INSTALL_FAILURE,
+                       "ospf_translated_nssa_refresh(): Could not install translated LSA, Id %s",
+                       inet_ntoa(type7->data->id));
                return NULL;
        }
 
index 2c813c3076d5c8eb1d4130a8858bc0ddef336b1b..ab25f1da4193d8138d72f0f76cddba38c6c1e56c 100644 (file)
@@ -826,7 +826,8 @@ static int ospf_router_info_lsa_originate1(void *arg)
 
        /* Install this LSA into LSDB. */
        if (ospf_lsa_install(top, NULL /*oi */, new) == NULL) {
-               zlog_warn(
+               flog_warn(
+                       OSPF_WARN_LSA_INSTALL_FAILURE,
                        "ospf_router_info_lsa_originate1: ospf_lsa_install() ?");
                ospf_lsa_unlock(&new);
                return rc;
@@ -927,7 +928,8 @@ static struct ospf_lsa *ospf_router_info_lsa_refresh(struct ospf_lsa *lsa)
        /* Given "lsa" will be freed in the next function. */
        top = ospf_lookup_by_vrf_id(lsa->vrf_id);
        if (ospf_lsa_install(top, NULL /*oi */, new) == NULL) {
-               zlog_warn("ospf_router_info_lsa_refresh: ospf_lsa_install() ?");
+               flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE,
+                         "ospf_router_info_lsa_refresh: ospf_lsa_install() ?");
                ospf_lsa_unlock(&new);
                return new;
        }
index abd3cf51fdaf82b642a09d462cd9c91111b6abff..12325f4fba6c0aef88595c1fbd60cfcab396421d 100644 (file)
@@ -1223,7 +1223,7 @@ static int ospf_mpls_te_lsa_originate1(struct ospf_area *area,
 
        /* Install this LSA into LSDB. */
        if (ospf_lsa_install(area->ospf, NULL /*oi*/, new) == NULL) {
-               flog_warn(OSPF_WARN_TE_UNEXPECTED,
+               flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE,
                          "ospf_mpls_te_lsa_originate1: ospf_lsa_install() ?");
                ospf_lsa_unlock(&new);
                return rc;
@@ -1325,7 +1325,7 @@ static int ospf_mpls_te_lsa_originate2(struct ospf *top,
 
        /* Install this LSA into LSDB. */
        if (ospf_lsa_install(top, NULL /*oi */, new) == NULL) {
-               flog_warn(OSPF_WARN_LSA_UNEXPECTED,
+               flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE,
                          "ospf_mpls_te_lsa_originate2: ospf_lsa_install() ?");
                ospf_lsa_unlock(&new);
                return rc;
@@ -1467,7 +1467,7 @@ static struct ospf_lsa *ospf_mpls_te_lsa_refresh(struct ospf_lsa *lsa)
                top = area->ospf;
 
        if (ospf_lsa_install(top, NULL /*oi */, new) == NULL) {
-               flog_warn(OSPF_WARN_TE_UNEXPECTED,
+               flog_warn(OSPF_WARN_LSA_INSTALL_FAILURE,
                          "ospf_mpls_te_lsa_refresh: ospf_lsa_install() ?");
                ospf_lsa_unlock(&new);
                return NULL;