summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/lib_errors.c6
-rw-r--r--lib/lib_errors.h1
-rw-r--r--lib/routemap.c4
3 files changed, 10 insertions, 1 deletions
diff --git a/lib/lib_errors.c b/lib/lib_errors.c
index 01fa27e82c..9f9c1c7c04 100644
--- a/lib/lib_errors.c
+++ b/lib/lib_errors.c
@@ -47,6 +47,12 @@ static struct log_ref ferr_lib_warn[] = {
.suggestion = "Gather log data and open an Issue",
},
{
+ .code = LIB_WARN_RMAP_RECURSION_LIMIT,
+ .title = "Reached the Route-Map Recursion Limit",
+ .description = "The Route-Map subsystem has detected a route-map depth of RMAP_RECURSION_LIMIT and has stopped processing",
+ .suggestion = "Re-work the Route-Map in question to not have so many route-map statements, or recompile FRR with a higher limit",
+ },
+ {
.code = END_FERR,
},
};
diff --git a/lib/lib_errors.h b/lib/lib_errors.h
index d4581918c7..67af0c95f2 100644
--- a/lib/lib_errors.h
+++ b/lib/lib_errors.h
@@ -42,6 +42,7 @@ enum lib_log_refs {
LIB_WARN_STREAM,
LIB_WARN_LINUX_NS,
LIB_WARN_SLOW_THREAD,
+ LIB_WARN_RMAP_RECURSION_LIMIT,
};
extern void lib_error_init(void);
diff --git a/lib/routemap.c b/lib/routemap.c
index e5613c2081..9e3dd3c0ae 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -30,6 +30,7 @@
#include "log.h"
#include "hash.h"
#include "libfrr.h"
+#include "lib_errors.h"
DEFINE_MTYPE_STATIC(LIB, ROUTE_MAP, "Route map")
DEFINE_MTYPE(LIB, ROUTE_MAP_NAME, "Route map name")
@@ -1445,7 +1446,8 @@ route_map_result_t route_map_apply(struct route_map *map,
struct route_map_rule *set;
if (recursion > RMAP_RECURSION_LIMIT) {
- zlog_warn(
+ flog_warn(
+ LIB_WARN_RMAP_RECURSION_LIMIT,
"route-map recursion limit (%d) reached, discarding route",
RMAP_RECURSION_LIMIT);
recursion = 0;