Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routemap debugging #12796

Merged
merged 11 commits into from
Feb 14, 2023
Merged
Prev Previous commit
Next Next commit
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 <sharpd@nvidia.com>
  • Loading branch information
donaldsharp committed Feb 13, 2023
commit 46b2a036a54669766b5baf6c0caeda6bacef982a
14 changes: 12 additions & 2 deletions ospfd/ospf_routemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down