mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 05:18:47 +00:00
Merge pull request #713 from qlyoung/fix-zebra-dbz-3.0
Fix zebra div by zero
This commit is contained in:
commit
18483e8fb3
@ -476,18 +476,15 @@ DEFUN (ip_irdp_minadvertinterval,
|
|||||||
zi=ifp->info;
|
zi=ifp->info;
|
||||||
irdp=&zi->irdp;
|
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);
|
irdp->MinAdvertInterval = atoi(argv[idx_number]->arg);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
vty_out (vty, "ICMP warning maxadvertinterval is greater or equal than minadvertinterval%s",
|
vty_out (vty, "%% MinAdvertInterval must be less than or equal to "
|
||||||
VTY_NEWLINE);
|
"MaxAdvertInterval%s", VTY_NEWLINE);
|
||||||
|
|
||||||
vty_out (vty, "Please correct!%s",
|
|
||||||
VTY_NEWLINE);
|
|
||||||
return CMD_WARNING;
|
return CMD_WARNING;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN (ip_irdp_maxadvertinterval,
|
DEFUN (ip_irdp_maxadvertinterval,
|
||||||
@ -506,19 +503,15 @@ DEFUN (ip_irdp_maxadvertinterval,
|
|||||||
zi=ifp->info;
|
zi=ifp->info;
|
||||||
irdp=&zi->irdp;
|
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);
|
irdp->MaxAdvertInterval = atoi(argv[idx_number]->arg);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
vty_out (vty, "ICMP warning maxadvertinterval is greater or equal than minadvertinterval%s",
|
vty_out (vty, "%% MaxAdvertInterval must be greater than or equal to "
|
||||||
VTY_NEWLINE);
|
"MinAdvertInterval%s", VTY_NEWLINE);
|
||||||
|
|
||||||
vty_out (vty, "Please correct!%s",
|
|
||||||
VTY_NEWLINE);
|
|
||||||
return CMD_WARNING;
|
return CMD_WARNING;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DEFUN needs to be fixed for negative ranages...
|
/* DEFUN needs to be fixed for negative ranages...
|
||||||
|
@ -234,7 +234,7 @@ int irdp_send_thread(struct thread *t_advert)
|
|||||||
}
|
}
|
||||||
|
|
||||||
tmp = irdp->MaxAdvertInterval-irdp->MinAdvertInterval;
|
tmp = irdp->MaxAdvertInterval-irdp->MinAdvertInterval;
|
||||||
timer = (random () % tmp ) + 1;
|
timer = random () % (tmp + 1);
|
||||||
timer = irdp->MinAdvertInterval + timer;
|
timer = irdp->MinAdvertInterval + timer;
|
||||||
|
|
||||||
if(irdp->irdp_sent < MAX_INITIAL_ADVERTISEMENTS &&
|
if(irdp->irdp_sent < MAX_INITIAL_ADVERTISEMENTS &&
|
||||||
|
Loading…
Reference in New Issue
Block a user