summaryrefslogtreecommitdiff
path: root/lib/routemap.c
diff options
context:
space:
mode:
authorpaul <paul>2005-05-23 12:43:34 +0000
committerpaul <paul>2005-05-23 12:43:34 +0000
commitd4f0960cb23abc7528d7282fa08c68131eae5f93 (patch)
tree8a1bc8eac474c49ca76f27971c65f74fd5a74c89 /lib/routemap.c
parentd5c925396629ef93cb38c2a63c3ac63911a341a6 (diff)
2005-05-23 Paul Jakma <paul@dishone.st>
* routemap.c: (rmap_onmatch_goto) fix crash if 'continue' command is used, which does not supply an argv[0]. this is a backport candidate /iff/ the trailing ; is removed from VTY_GET_INTEGER_RANGE * vty.h: fix the VTY_GET macros, do {..} while(0) so they have correct function like syntax in usage.
Diffstat (limited to 'lib/routemap.c')
-rw-r--r--lib/routemap.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/routemap.c b/lib/routemap.c
index c52b050a..0a4eeb99 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -26,6 +26,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#include "prefix.h"
#include "routemap.h"
#include "command.h"
+#include "vty.h"
#include "log.h"
/* Vector for route match rules. */
@@ -1063,15 +1064,16 @@ DEFUN (rmap_onmatch_goto,
"Goto Clause number\n"
"Number\n")
{
- struct route_map_index *index;
+ struct route_map_index *index = vty->index;
int d = 0;
- if (argv[0])
- d = atoi(argv[0]);
-
- index = vty->index;
if (index)
{
+ if (argc == 1 && argv[0])
+ VTY_GET_INTEGER_RANGE("route-map index", d, argv[0], 1, 65536);
+ else
+ d = index->pref + 1;
+
if (d <= index->pref)
{
/* Can't allow you to do that, Dave */