]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Convert routemap.c to use new error-code subsystem
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 20 Aug 2018 14:21:03 +0000 (10:21 -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>
lib/lib_errors.c
lib/lib_errors.h
lib/routemap.c

index 01fa27e82cc49d9462fb307f3772f45ce511c63d..9f9c1c7c04dcf48be4e1667e94739688d8045269 100644 (file)
@@ -46,6 +46,12 @@ static struct log_ref ferr_lib_warn[] = {
                .description = "The Event subsystem has detected a slow process, this typically indicates that FRR is having trouble completing work in a timely manner.  This can be either a misconfiguration, bug, or some combination therof.",
                .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,
        },
index d4581918c7a20a3098a65134e6fe41b106313b40..67af0c95f231719e87475240a81edda027d7e67b 100644 (file)
@@ -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);
index e5613c2081530e701b9dbeeb87b21693ce7cdf5e..9e3dd3c0ae50a2a25dd11b3c7b75e500df7d0f6c 100644 (file)
@@ -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;