summaryrefslogtreecommitdiffstats
path: root/zebra/irdp_interface.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-06-16 18:18:54 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-06-16 18:33:46 +0200
commit11e2897282839b66f7566b056c14b2558d2df354 (patch)
treeddb01c1e715b658aadb9a838f21db4270696dcf8 /zebra/irdp_interface.c
parentzebra: fix divide-by-zero (diff)
downloadfrr-11e2897282839b66f7566b056c14b2558d2df354.tar.xz
frr-11e2897282839b66f7566b056c14b2558d2df354.zip
zebra: more dbzing
Revert to the previous <= restrictions, improve error messages, fix the divide by zero. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'zebra/irdp_interface.c')
-rw-r--r--zebra/irdp_interface.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/zebra/irdp_interface.c b/zebra/irdp_interface.c
index 6ea14b305..407738d80 100644
--- a/zebra/irdp_interface.c
+++ b/zebra/irdp_interface.c
@@ -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;
}
}