]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: Convert ospf_sr.c to use error-card subsystem.
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 21 Aug 2018 13:46:53 +0000 (09:46 -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_sr.c

index 2c6b3499e0742520a6fef21dcbb483ff092cc165..5ee56838aa4a327e559c322e2c73aa8c1aa6980b 100644 (file)
@@ -1099,7 +1099,7 @@ void ospf_sr_ri_lsa_update(struct ospf_lsa *lsa)
 
        if (OspfSR.neighbors == NULL) {
                flog_err(OSPF_ERR_SR_INVALID_DB,
-                         "SR (%s): Abort! no valid SR DataBase", __func__);
+                        "SR (%s): Abort! no valid SR DataBase", __func__);
                return;
        }
 
@@ -1163,8 +1163,9 @@ void ospf_sr_ri_lsa_update(struct ospf_lsa *lsa)
        /* Check that we collect mandatory parameters */
        if (srn->algo[0] == SR_ALGORITHM_UNSET || srgb.range_size == 0
            || srgb.lower_bound == 0) {
-               zlog_warn("SR (%s): Missing mandatory parameters. Abort!",
-                         __func__);
+               flog_err(OSPF_ERR_SR_NODE_CREATE,
+                        "SR (%s): Missing mandatory parameters. Abort!",
+                        __func__);
                hash_release(OspfSR.neighbors, &(srn->adv_router));
                XFREE(MTYPE_OSPF_SR_PARAMS, srn);
                return;
@@ -1210,7 +1211,7 @@ void ospf_sr_ri_lsa_delete(struct ospf_lsa *lsa)
        /* Sanity check */
        if (OspfSR.neighbors == NULL) {
                flog_err(OSPF_ERR_SR_INVALID_DB,
-                         "SR (%s): Abort! no valid SR Data Base", __func__);
+                        "SR (%s): Abort! no valid SR Data Base", __func__);
                return;
        }
 
@@ -1257,7 +1258,7 @@ void ospf_sr_ext_link_lsa_update(struct ospf_lsa *lsa)
        /* Sanity check */
        if (OspfSR.neighbors == NULL) {
                flog_err(OSPF_ERR_SR_INVALID_DB,
-                         "SR (%s): Abort! no valid SR DataBase", __func__);
+                        "SR (%s): Abort! no valid SR DataBase", __func__);
                return;
        }
 
@@ -1309,7 +1310,7 @@ void ospf_sr_ext_link_lsa_delete(struct ospf_lsa *lsa)
        /* Sanity check */
        if (OspfSR.neighbors == NULL) {
                flog_err(OSPF_ERR_SR_INVALID_DB,
-                         "SR (%s): Abort! no valid SR DataBase", __func__);
+                        "SR (%s): Abort! no valid SR DataBase", __func__);
                return;
        }
 
@@ -1322,8 +1323,9 @@ void ospf_sr_ext_link_lsa_delete(struct ospf_lsa *lsa)
         * processing Router Information LSA deletion
         */
        if (srn == NULL) {
-               zlog_warn("SR (%s): Stop! no entry in SRDB for SR Node %s",
-                         __func__, inet_ntoa(lsah->adv_router));
+               flog_err(OSPF_ERR_SR_INVALID_DB,
+                        "SR (%s): Stop! no entry in SRDB for SR Node %s",
+                        __func__, inet_ntoa(lsah->adv_router));
                return;
        }
 
@@ -1339,11 +1341,11 @@ void ospf_sr_ext_link_lsa_delete(struct ospf_lsa *lsa)
                listnode_delete(srn->ext_link, srl);
                XFREE(MTYPE_OSPF_SR_PARAMS, srl);
        } else {
-               zlog_warn(
-                       "SR (%s): Didn't found corresponding SR Link 8.0.0.%u "
-                       "for SR Node %s",
-                       __func__, GET_OPAQUE_ID(ntohl(lsah->id.s_addr)),
-                       inet_ntoa(lsah->adv_router));
+               flog_err(OSPF_ERR_SR_INVALID_DB,
+                        "SR (%s): Didn't found corresponding SR Link 8.0.0.%u "
+                        "for SR Node %s",
+                        __func__, GET_OPAQUE_ID(ntohl(lsah->id.s_addr)),
+                        inet_ntoa(lsah->adv_router));
        }
 }
 
@@ -1367,7 +1369,7 @@ void ospf_sr_ext_prefix_lsa_update(struct ospf_lsa *lsa)
        /* Sanity check */
        if (OspfSR.neighbors == NULL) {
                flog_err(OSPF_ERR_SR_INVALID_DB,
-                         "SR (%s): Abort! no valid SR DataBase", __func__);
+                        "SR (%s): Abort! no valid SR DataBase", __func__);
                return;
        }
 
@@ -1379,8 +1381,8 @@ void ospf_sr_ext_prefix_lsa_update(struct ospf_lsa *lsa)
        /* Sanity check */
        if (srn == NULL) {
                flog_err(OSPF_ERR_SR_NODE_CREATE,
-                         "SR (%s): Abort! can't create SR node in hash table",
-                         __func__);
+                        "SR (%s): Abort! can't create SR node in hash table",
+                        __func__);
                return;
        }
 
@@ -1420,7 +1422,7 @@ void ospf_sr_ext_prefix_lsa_delete(struct ospf_lsa *lsa)
        /* Sanity check */
        if (OspfSR.neighbors == NULL) {
                flog_err(OSPF_ERR_SR_INVALID_DB,
-                         "SR (%s): Abort! no valid SR DataBase", __func__);
+                        "SR (%s): Abort! no valid SR DataBase", __func__);
                return;
        }
 
@@ -1433,8 +1435,9 @@ void ospf_sr_ext_prefix_lsa_delete(struct ospf_lsa *lsa)
         * processing Router Information LSA deletion
         */
        if (srn == NULL) {
-               zlog_warn("SR (%s):  Stop! no entry in SRDB for SR Node %s",
-                         __func__, inet_ntoa(lsah->adv_router));
+               flog_err(OSPF_ERR_SR_INVALID_DB,
+                        "SR (%s):  Stop! no entry in SRDB for SR Node %s",
+                        __func__, inet_ntoa(lsah->adv_router));
                return;
        }
 
@@ -1449,9 +1452,9 @@ void ospf_sr_ext_prefix_lsa_delete(struct ospf_lsa *lsa)
                listnode_delete(srn->ext_link, srp);
                XFREE(MTYPE_OSPF_SR_PARAMS, srp);
        } else {
-               zlog_warn(
-                       "SR (%s): Didn't found corresponding SR Prefix "
-                       "7.0.0.%u for SR Node %s",
+               flog_err(
+                       OSPF_ERR_SR_INVALID_DB,
+                       "SR (%s): Didn't found corresponding SR Prefix 7.0.0.%u for SR Node %s",
                        __func__, GET_OPAQUE_ID(ntohl(lsah->id.s_addr)),
                        inet_ntoa(lsah->adv_router));
        }