summaryrefslogtreecommitdiffstats
path: root/ospfd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-08-21 15:22:33 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-09-06 22:50:58 +0200
commit13ab4921b1584c2ccc034a001d239873c7645d01 (patch)
tree259eec2cff21882083b05aa47535029c3e6cbab6 /ospfd
parentospfd: Convert ospf_asbr.c to use error-codes subsystem (diff)
downloadfrr-13ab4921b1584c2ccc034a001d239873c7645d01.tar.xz
frr-13ab4921b1584c2ccc034a001d239873c7645d01.zip
ospfd: Convert ospf_lsa.c to use new error-card Syntax
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_errors.c12
-rw-r--r--ospfd/ospf_errors.h2
-rw-r--r--ospfd/ospf_lsa.c49
3 files changed, 45 insertions, 18 deletions
diff --git a/ospfd/ospf_errors.c b/ospfd/ospf_errors.c
index 0eb68755c..b3673a7f7 100644
--- a/ospfd/ospf_errors.c
+++ b/ospfd/ospf_errors.c
@@ -98,6 +98,18 @@ static struct log_ref ferr_ospf_warn[] = {
.suggestion = "Gather data from this machine and open an Issue",
},
{
+ .code = OSPF_WARN_PTP_NEIGHBOR,
+ .title = "OSPF has detected more than 1 neighbor on a P2P interface",
+ .description = "If you configure a ospf interface as P2P we should not detect more than one neighbor on the interface",
+ .suggestion = "Fix your config",
+ },
+ {
+ .code = OSPF_WARN_LSA_SIZE,
+ .title = "OSPF has detected an invalid LSA size",
+ .description = "OSPF has detected a state where we are attempting to grow a LSA but the LSA has reached it's maximum size",
+ .suggestion = "Gather data and open an Issue",
+ },
+ {
.code = END_FERR,
}
};
diff --git a/ospfd/ospf_errors.h b/ospfd/ospf_errors.h
index 33fbec888..f0e9e3da9 100644
--- a/ospfd/ospf_errors.h
+++ b/ospfd/ospf_errors.h
@@ -44,6 +44,8 @@ enum ospf_log_refs {
OSPF_WARN_LSA_NULL,
OSPF_WARN_EXT_LSA_UNEXPECTED,
OSPF_WARN_LSA_MISSING,
+ OSPF_WARN_PTP_NEIGHBOR,
+ OSPF_WARN_LSA_SIZE,
};
extern void ospf_error_init(void);
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index b2056e59c..4d46e9739 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -398,7 +398,8 @@ struct ospf_neighbor *ospf_nbr_lookup_ptop(struct ospf_interface *oi)
/* PtoP link must have only 1 neighbor. */
if (ospf_nbr_count(oi, 0) > 1)
- zlog_warn("Point-to-Point link has more than 1 neighobrs.");
+ flog_warn(OSPF_WARN_PTP_NEIGHBOR,
+ "Point-to-Point link has more than 1 neighobrs.");
return nbr;
}
@@ -446,7 +447,8 @@ static char link_info_set(struct stream **s, struct in_addr id,
}
if (ret == OSPF_MAX_LSA_SIZE) {
- zlog_warn(
+ flog_warn(
+ OSPF_WARN_LSA_SIZE,
"%s: Out of space in LSA stream, left %zd, size %zd",
__func__, STREAM_WRITEABLE(*s),
STREAM_SIZE(*s));
@@ -2041,19 +2043,28 @@ int ospf_external_lsa_originate_timer(struct thread *thread)
if (!ext_list)
return 0;
- for (ALL_LIST_ELEMENTS_RO(ext_list, node, ext))
+ for (ALL_LIST_ELEMENTS_RO(ext_list, node, ext)) {
/* Originate As-external-LSA from all type of distribute source.
*/
- if ((rt = ext->external_info))
- for (rn = route_top(rt); rn; rn = route_next(rn))
- if ((ei = rn->info) != NULL)
- if (!is_prefix_default(
- (struct prefix_ipv4 *)&ei
- ->p))
- if (!ospf_external_lsa_originate(
- ospf, ei))
- zlog_warn(
- "LSA: AS-external-LSA was not originated.");
+ rt = ext->external_info;
+ if (!rt)
+ continue;
+
+ for (rn = route_top(rt); rn; rn = route_next(rn)) {
+ ei = rn->info;
+
+ if (!ei)
+ continue;
+
+ if (is_prefix_default((struct prefix_ipv4 *)&ei->p))
+ continue;
+
+ if (!ospf_external_lsa_originate(ospf, ei))
+ flog_warn(
+ OSPF_WARN_LSA_INSTALL_FAILURE,
+ "LSA: AS-external-LSA was not originated.");
+ }
+ }
return 0;
}
@@ -2832,11 +2843,13 @@ static int ospf_maxage_lsa_remover(struct thread *thread)
if (lsa->lsdb) {
ospf_discard_from_db(ospf, lsa->lsdb, lsa);
ospf_lsdb_delete(lsa->lsdb, lsa);
- } else
- zlog_warn(
- "%s: LSA[Type%d:%s]: No associated LSDB!",
- __func__, lsa->data->type,
- inet_ntoa(lsa->data->id));
+ } else {
+ if (IS_DEBUG_OSPF(lsa, LSA_FLOODING))
+ zlog_debug(
+ "%s: LSA[Type%d:%s]: No associated LSDB!",
+ __func__, lsa->data->type,
+ inet_ntoa(lsa->data->id));
+ }
}
/* A MaxAge LSA must be removed immediately from the router's link