summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2020-10-14 19:15:49 -0400
committerGitHub <noreply@github.com>2020-10-14 19:15:49 -0400
commit974c396af3f21f76659f77177e218bd09dc401d3 (patch)
tree1fa6cc9d57e079a8bd4b1be75dfa2ac7bd18dccb
parent6431621e4eb11c4b85d6c29f79d060d59b0ed5d2 (diff)
parent17b4e8c43903d328b2966e90e71c965a65ba408a (diff)
Merge pull request #7310 from idryzhov/fix-no-bgp-as-path
bgpd: print error when as-path filter doesn't exist
-rw-r--r--bgpd/bgp_filter.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bgpd/bgp_filter.c b/bgpd/bgp_filter.c
index 0308a30d54..3162579688 100644
--- a/bgpd/bgp_filter.c
+++ b/bgpd/bgp_filter.c
@@ -507,14 +507,16 @@ DEFUN(no_as_path, no_bgp_as_path_cmd,
/* Lookup asfilter. */
asfilter = as_filter_lookup(aslist, regstr, type);
- XFREE(MTYPE_TMP, regstr);
bgp_regex_free(regex);
if (asfilter == NULL) {
- vty_out(vty, "\n");
+ vty_out(vty, "Regex entered %s does not exist\n", regstr);
+ XFREE(MTYPE_TMP, regstr);
return CMD_WARNING_CONFIG_FAILED;
}
+ XFREE(MTYPE_TMP, regstr);
+
as_list_filter_delete(aslist, asfilter);
return CMD_SUCCESS;