mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-12 22:27:47 +00:00
ripngd: limit max of "timers basic" to 65535 as documented
and use VTY_GET_INTEGER_RANGE instead of calling strtoul
This commit is contained in:
parent
5009160c74
commit
c0cad43688
@ -2485,28 +2485,10 @@ DEFUN (ripng_timers,
|
|||||||
unsigned long update;
|
unsigned long update;
|
||||||
unsigned long timeout;
|
unsigned long timeout;
|
||||||
unsigned long garbage;
|
unsigned long garbage;
|
||||||
char *endptr = NULL;
|
|
||||||
|
|
||||||
update = strtoul (argv[0], &endptr, 10);
|
VTY_GET_INTEGER_RANGE("update timer", update, argv[0], 0, 65535);
|
||||||
if (update == ULONG_MAX || *endptr != '\0')
|
VTY_GET_INTEGER_RANGE("timeout timer", timeout, argv[1], 0, 65535);
|
||||||
{
|
VTY_GET_INTEGER_RANGE("garbage timer", garbage, argv[2], 0, 65535);
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set each timer value. */
|
/* Set each timer value. */
|
||||||
ripng->update_time = update;
|
ripng->update_time = update;
|
||||||
|
Loading…
Reference in New Issue
Block a user