From 46b2a036a54669766b5baf6c0caeda6bacef982a Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 13 Feb 2023 09:30:44 -0500 Subject: [PATCH] ospfd: Add access-list lookup failures to routemap code When using access-list and the access-list is not specified let's give the operator some clue about what is going on. Signed-off-by: Donald Sharp --- ospfd/ospf_routemap.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ospfd/ospf_routemap.c b/ospfd/ospf_routemap.c index b1216626c4..703d342b33 100644 --- a/ospfd/ospf_routemap.c +++ b/ospfd/ospf_routemap.c @@ -134,8 +134,13 @@ route_match_ip_nexthop(void *rule, const struct prefix *prefix, void *object) p.prefixlen = IPV4_MAX_BITLEN; 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); @@ -249,8 +254,13 @@ route_match_ip_address(void *rule, const struct prefix *prefix, void *object) /* struct prefix_ipv4 match; */ 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, prefix) == FILTER_DENY ? RMAP_NOMATCH : RMAP_MATCH);