summaryrefslogtreecommitdiff
path: root/src/tools/ocbr/ocbr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/ocbr/ocbr.c')
-rw-r--r--src/tools/ocbr/ocbr.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/tools/ocbr/ocbr.c b/src/tools/ocbr/ocbr.c
index 2643b588..775bcaac 100644
--- a/src/tools/ocbr/ocbr.c
+++ b/src/tools/ocbr/ocbr.c
@@ -1,5 +1,5 @@
/*
- * Ouroboros - Copyright (C) 2016 - 2021
+ * Ouroboros - Copyright (C) 2016 - 2024
*
* CBR traffic generator
*
@@ -155,17 +155,22 @@ int main(int argc, char ** argv)
if (s_apn == NULL) {
printf("No server specified.\n");
usage();
- return 0;
+ return 1;
}
if (size > BUF_SIZE) {
printf("Maximum size: %ld.\n", BUF_SIZE);
- return 0;
+ return 1;
}
if (size < 0) {
printf("Size overflow.\n");
- return 0;
+ return 1;
+ }
+
+ if (rate <= 0) {
+ printf("Invalid rate.\n");
+ return 1;
}
ret = client_main(s_apn, duration, size, rate, flood, sleep);