From 774cd0cd6c55f293fabbda8fc717aed5ccc5d029 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 13 Feb 2023 09:35:55 -0500 Subject: [PATCH] zebra: Add access-list lookup failures to debug routemap detail Signed-off-by: Donald Sharp --- zebra/zebra_routemap.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c index 7a0bb5bf46..8f24404a44 100644 --- a/zebra/zebra_routemap.c +++ b/zebra/zebra_routemap.c @@ -1055,8 +1055,13 @@ route_match_ip_next_hop(void *rule, const struct prefix *prefix, void *object) return RMAP_NOMATCH; } alist = access_list_lookup(AFI_IP, (char *)rule); - if (alist == NULL) + if (alist == NULL) { + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL)) + zlog_debug( + "%s: Access-List Specified: %s does not exist defaulting to NO_MATCH", + __func__, (char *)rule); return RMAP_NOMATCH; + } return (access_list_apply(alist, &p) == FILTER_DENY ? RMAP_NOMATCH : RMAP_MATCH); @@ -1154,8 +1159,13 @@ route_match_address(afi_t afi, void *rule, const struct prefix *prefix, struct access_list *alist; alist = access_list_lookup(afi, (char *)rule); - if (alist == NULL) + if (alist == NULL) { + if (CHECK_FLAG(rmap_debug, DEBUG_ROUTEMAP_DETAIL)) + zlog_debug( + "%s: Access-List Specified: %s does not exist defaulting to NO_MATCH", + __func__, (char *)rule); return RMAP_NOMATCH; + } return (access_list_apply(alist, prefix) == FILTER_DENY ? RMAP_NOMATCH : RMAP_MATCH);