summaryrefslogtreecommitdiff
path: root/ripngd/ripngd.c
diff options
context:
space:
mode:
authorUlrich Weber <ulrich.weber@sophos.com>2011-11-17 21:35:08 +0400
committerDenis Ovsienko <infrastation@yandex.ru>2011-12-13 14:25:33 +0400
commit6989880ad7699cb6bf0cfc0fbb95da51430652cf (patch)
treed1cb56e502df05b7cadabd3390a29c32429c930e /ripngd/ripngd.c
parentbde12e3fd5e498a266e813a5751c1b2d21e46ca5 (diff)
ripngd: limit max of "timers basic" to 65535 as documented
and use VTY_GET_INTEGER_RANGE instead of calling strtoul
Diffstat (limited to 'ripngd/ripngd.c')
-rw-r--r--ripngd/ripngd.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index d416255c..8e97c2f8 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -2485,28 +2485,10 @@ DEFUN (ripng_timers,
unsigned long update;
unsigned long timeout;
unsigned long garbage;
- char *endptr = NULL;
- update = strtoul (argv[0], &endptr, 10);
- if (update == ULONG_MAX || *endptr != '\0')
- {
- vty_out (vty, "update timer value error%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- timeout = strtoul (argv[1], &endptr, 10);
- if (timeout == ULONG_MAX || *endptr != '\0')
- {
- vty_out (vty, "timeout timer value error%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- garbage = strtoul (argv[2], &endptr, 10);
- if (garbage == ULONG_MAX || *endptr != '\0')
- {
- vty_out (vty, "garbage timer value error%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
+ VTY_GET_INTEGER_RANGE("update timer", update, argv[0], 0, 65535);
+ VTY_GET_INTEGER_RANGE("timeout timer", timeout, argv[1], 0, 65535);
+ VTY_GET_INTEGER_RANGE("garbage timer", garbage, argv[2], 0, 65535);
/* Set each timer value. */
ripng->update_time = update;