From 7ebab1fb57beac8dd1afc51e4b3e0ef2eb085b45 Mon Sep 17 00:00:00 2001 From: Don Slice Date: Wed, 13 Jan 2016 06:02:46 -0800 Subject: [PATCH] lib:removed onmatch next and onmatch goto from route-map deny Ticket: CM-7566 Reviewed By: Daniel Walton, Donald Sharp Testing Done: Manual testing - see bug Since on a route-map deny clause, the route-map will end on match, the on-match next and on-match goto statements are meaningless and confusing. Removed them. Signed-off-by: Don Slice --- lib/routemap.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/routemap.c b/lib/routemap.c index e760dacf7d..53df69dfcd 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -1531,8 +1531,16 @@ DEFUN (rmap_onmatch_next, index = vty->index; if (index) - index->exitpolicy = RMAP_NEXT; - + { + if (index->type == RMAP_DENY) + { + /* Under a deny clause, match means it's finished. No need to set next */ + vty_out (vty, "on-match next not supported under route-map deny%s", + VTY_NEWLINE); + return CMD_WARNING; + } + index->exitpolicy = RMAP_NEXT; + } return CMD_SUCCESS; } @@ -1565,6 +1573,14 @@ DEFUN (rmap_onmatch_goto, if (index) { + if (index->type == RMAP_DENY) + { + /* Under a deny clause, match means it's finished. No need to go anywhere */ + vty_out (vty, "on-match goto not supported under route-map deny%s", + VTY_NEWLINE); + return CMD_WARNING; + } + if (argc == 1 && argv[0]) VTY_GET_INTEGER_RANGE("route-map index", d, argv[0], 1, 65536); else -- 2.39.5