mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 23:09:34 +00:00
zebra: fix divide-by-zero
x % 0 = FPE Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
93f855c24a
commit
6196c77a4f
@ -476,19 +476,15 @@ 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;
|
||||
}
|
||||
|
||||
vty_out (vty, "ICMP warning maxadvertinterval is greater or equal than minadvertinterval%s",
|
||||
VTY_NEWLINE);
|
||||
|
||||
vty_out (vty, "Please correct!%s",
|
||||
VTY_NEWLINE);
|
||||
else {
|
||||
vty_out (vty, "%% MinAdvertInterval must be less than MaxAdvertInterval");
|
||||
return CMD_WARNING;
|
||||
}
|
||||
}
|
||||
|
||||
DEFUN (ip_irdp_maxadvertinterval,
|
||||
ip_irdp_maxadvertinterval_cmd,
|
||||
@ -506,20 +502,15 @@ 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;
|
||||
}
|
||||
|
||||
vty_out (vty, "ICMP warning maxadvertinterval is greater or equal than minadvertinterval%s",
|
||||
VTY_NEWLINE);
|
||||
|
||||
vty_out (vty, "Please correct!%s",
|
||||
VTY_NEWLINE);
|
||||
else {
|
||||
vty_out (vty, "%% MaxAdvertInterval must be greater than MinAdvertInterval");
|
||||
return CMD_WARNING;
|
||||
}
|
||||
}
|
||||
|
||||
/* DEFUN needs to be fixed for negative ranages...
|
||||
* "ip irdp preference <-2147483648-2147483647>",
|
||||
|
@ -234,6 +234,7 @@ int irdp_send_thread(struct thread *t_advert)
|
||||
}
|
||||
|
||||
tmp = irdp->MaxAdvertInterval-irdp->MinAdvertInterval;
|
||||
assert (tmp > 0);
|
||||
timer = (random () % tmp) + 1;
|
||||
timer = irdp->MinAdvertInterval + timer;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user