summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_sr.c
diff options
context:
space:
mode:
authorChirag Shah <chirag@cumulusnetworks.com>2018-06-19 22:41:28 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-08-14 22:02:05 +0200
commit313d7993a35571dabf8c2b2ecdf538b0686aae74 (patch)
treefed04413cd7b3b49cf8ce678162891bc37266de3 /ospfd/ospf_sr.c
parentlib: Convert zlog_err for clippy build (diff)
downloadfrr-313d7993a35571dabf8c2b2ecdf538b0686aae74.tar.xz
frr-313d7993a35571dabf8c2b2ecdf538b0686aae74.zip
ospfd: zlog_ferr facility
Ticket:CM-21333 Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospf_sr.c')
-rw-r--r--ospfd/ospf_sr.c62
1 files changed, 38 insertions, 24 deletions
diff --git a/ospfd/ospf_sr.c b/ospfd/ospf_sr.c
index 25983ddc5..629edbf37 100644
--- a/ospfd/ospf_sr.c
+++ b/ospfd/ospf_sr.c
@@ -48,6 +48,7 @@
#include "vty.h"
#include "zclient.h"
#include <lib/json.h>
+#include "ospf_errors.h"
#include "ospfd/ospfd.h"
#include "ospfd/ospf_interface.h"
@@ -820,8 +821,9 @@ static struct sr_prefix *get_ext_prefix_sid(struct tlv_header *tlvh)
case EXT_SUBTLV_PREFIX_SID:
psid = (struct ext_subtlv_prefix_sid *)sub_tlvh;
if (psid->algorithm != SR_ALGORITHM_SPF) {
- zlog_err("SR (%s): Unsupported Algorithm",
- __func__);
+ zlog_ferr(OSPF_ERR_SR_INVALID_ALGORITHM,
+ "SR (%s): Unsupported Algorithm",
+ __func__);
XFREE(MTYPE_OSPF_SR_PARAMS, srp);
return NULL;
}
@@ -1100,7 +1102,8 @@ void ospf_sr_ri_lsa_update(struct ospf_lsa *lsa)
return;
if (OspfSR.neighbors == NULL) {
- zlog_err("SR (%s): Abort! no valid SR DataBase", __func__);
+ zlog_ferr(OSPF_ERR_SR_INVALID_DB,
+ "SR (%s): Abort! no valid SR DataBase", __func__);
return;
}
@@ -1110,17 +1113,18 @@ void ospf_sr_ri_lsa_update(struct ospf_lsa *lsa)
/* Sanity check */
if (srn == NULL) {
- zlog_err("SR (%s): Abort! can't create SR node in hash table",
- __func__);
+ zlog_ferr(OSPF_ERR_SR_NODE_CREATE,
+ "SR (%s): Abort! can't create SR node in hash table",
+ __func__);
return;
}
if ((srn->instance != 0) && (srn->instance != ntohl(lsah->id.s_addr))) {
- zlog_err(
- "SR (%s): Abort! Wrong "
- "LSA ID 4.0.0.%u for SR node %s/%u",
- __func__, GET_OPAQUE_ID(ntohl(lsah->id.s_addr)),
- inet_ntoa(lsah->adv_router), srn->instance);
+ zlog_ferr(OSPF_ERR_SR_INVALID_LSA_ID,
+ "SR (%s): Abort! Wrong "
+ "LSA ID 4.0.0.%u for SR node %s/%u",
+ __func__, GET_OPAQUE_ID(ntohl(lsah->id.s_addr)),
+ inet_ntoa(lsah->adv_router), srn->instance);
return;
}
@@ -1209,7 +1213,8 @@ void ospf_sr_ri_lsa_delete(struct ospf_lsa *lsa)
/* Sanity check */
if (OspfSR.neighbors == NULL) {
- zlog_err("SR (%s): Abort! no valid SR Data Base", __func__);
+ zlog_ferr(OSPF_ERR_SR_INVALID_DB,
+ "SR (%s): Abort! no valid SR Data Base", __func__);
return;
}
@@ -1218,15 +1223,18 @@ void ospf_sr_ri_lsa_delete(struct ospf_lsa *lsa)
/* Sanity check */
if (srn == NULL) {
- zlog_err("SR (%s): Abort! no entry in SRDB for SR Node %s",
- __func__, inet_ntoa(lsah->adv_router));
+ zlog_ferr(OSPF_ERR_SR_NODE_CREATE,
+ "SR (%s): Abort! no entry in SRDB for SR Node %s",
+ __func__, inet_ntoa(lsah->adv_router));
return;
}
if ((srn->instance != 0) && (srn->instance != ntohl(lsah->id.s_addr))) {
- zlog_err("SR (%s): Abort! Wrong LSA ID 4.0.0.%u for SR node %s",
- __func__, GET_OPAQUE_ID(ntohl(lsah->id.s_addr)),
- inet_ntoa(lsah->adv_router));
+ zlog_ferr(
+ OSPF_ERR_SR_INVALID_LSA_ID,
+ "SR (%s): Abort! Wrong LSA ID 4.0.0.%u for SR node %s",
+ __func__, GET_OPAQUE_ID(ntohl(lsah->id.s_addr)),
+ inet_ntoa(lsah->adv_router));
return;
}
@@ -1252,7 +1260,8 @@ void ospf_sr_ext_link_lsa_update(struct ospf_lsa *lsa)
/* Sanity check */
if (OspfSR.neighbors == NULL) {
- zlog_err("SR (%s): Abort! no valid SR DataBase", __func__);
+ zlog_ferr(OSPF_ERR_SR_INVALID_DB,
+ "SR (%s): Abort! no valid SR DataBase", __func__);
return;
}
@@ -1263,8 +1272,9 @@ void ospf_sr_ext_link_lsa_update(struct ospf_lsa *lsa)
/* Sanity check */
if (srn == NULL) {
- zlog_err("SR (%s): Abort! can't create SR node in hash table",
- __func__);
+ zlog_ferr(OSPF_ERR_SR_NODE_CREATE,
+ "SR (%s): Abort! can't create SR node in hash table",
+ __func__);
return;
}
@@ -1302,7 +1312,8 @@ void ospf_sr_ext_link_lsa_delete(struct ospf_lsa *lsa)
/* Sanity check */
if (OspfSR.neighbors == NULL) {
- zlog_err("SR (%s): Abort! no valid SR DataBase", __func__);
+ zlog_ferr(OSPF_ERR_SR_INVALID_DB,
+ "SR (%s): Abort! no valid SR DataBase", __func__);
return;
}
@@ -1359,7 +1370,8 @@ void ospf_sr_ext_prefix_lsa_update(struct ospf_lsa *lsa)
/* Sanity check */
if (OspfSR.neighbors == NULL) {
- zlog_err("SR (%s): Abort! no valid SR DataBase", __func__);
+ zlog_ferr(OSPF_ERR_SR_INVALID_DB,
+ "SR (%s): Abort! no valid SR DataBase", __func__);
return;
}
@@ -1370,8 +1382,9 @@ void ospf_sr_ext_prefix_lsa_update(struct ospf_lsa *lsa)
/* Sanity check */
if (srn == NULL) {
- zlog_err("SR (%s): Abort! can't create SR node in hash table",
- __func__);
+ zlog_ferr(OSPF_ERR_SR_NODE_CREATE,
+ "SR (%s): Abort! can't create SR node in hash table",
+ __func__);
return;
}
@@ -1410,7 +1423,8 @@ void ospf_sr_ext_prefix_lsa_delete(struct ospf_lsa *lsa)
/* Sanity check */
if (OspfSR.neighbors == NULL) {
- zlog_err("SR (%s): Abort! no valid SR DataBase", __func__);
+ zlog_ferr(OSPF_ERR_SR_INVALID_DB,
+ "SR (%s): Abort! no valid SR DataBase", __func__);
return;
}