mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 23:53:28 +00:00
zebra: more dbzing
Revert to the previous <= restrictions, improve error messages, fix the divide by zero. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
6196c77a4f
commit
11e2897282
@ -476,12 +476,13 @@ DEFUN (ip_irdp_minadvertinterval,
|
||||
zi=ifp->info;
|
||||
irdp=&zi->irdp;
|
||||
|
||||
if((unsigned) atoi(argv[idx_number]->arg) < irdp->MaxAdvertInterval) {
|
||||
if((unsigned) atoi(argv[idx_number]->arg) <= irdp->MaxAdvertInterval) {
|
||||
irdp->MinAdvertInterval = atoi(argv[idx_number]->arg);
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
else {
|
||||
vty_out (vty, "%% MinAdvertInterval must be less than MaxAdvertInterval");
|
||||
vty_out (vty, "%% MinAdvertInterval must be less than or equal to "
|
||||
"MaxAdvertInterval%s", VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
}
|
||||
@ -502,12 +503,13 @@ DEFUN (ip_irdp_maxadvertinterval,
|
||||
zi=ifp->info;
|
||||
irdp=&zi->irdp;
|
||||
|
||||
if(irdp->MinAdvertInterval < (unsigned) atoi(argv[idx_number]->arg)) {
|
||||
if(irdp->MinAdvertInterval <= (unsigned) atoi(argv[idx_number]->arg)) {
|
||||
irdp->MaxAdvertInterval = atoi(argv[idx_number]->arg);
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
else {
|
||||
vty_out (vty, "%% MaxAdvertInterval must be greater than MinAdvertInterval");
|
||||
vty_out (vty, "%% MaxAdvertInterval must be greater than or equal to "
|
||||
"MinAdvertInterval%s", VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
}
|
||||
|
@ -234,8 +234,7 @@ int irdp_send_thread(struct thread *t_advert)
|
||||
}
|
||||
|
||||
tmp = irdp->MaxAdvertInterval-irdp->MinAdvertInterval;
|
||||
assert (tmp > 0);
|
||||
timer = (random () % tmp) + 1;
|
||||
timer = random () % (tmp + 1);
|
||||
timer = irdp->MinAdvertInterval + timer;
|
||||
|
||||
if(irdp->irdp_sent < MAX_INITIAL_ADVERTISEMENTS &&
|
||||
|
Loading…
Reference in New Issue
Block a user