Skip to content

Commit

Permalink
Changes per reviewer comments - limit omit time to MAX_OMIT_TIME
Browse files Browse the repository at this point in the history
  • Loading branch information
davidBar-On committed Nov 20, 2024
1 parent 31b63a0 commit e03c2cc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/iperf.h
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ struct iperf_test
#define MIN_INTERVAL 0.1
#define MAX_INTERVAL 60.0
#define MAX_TIME 86400
#define MAX_OMIT_TIME 600
#define MAX_BURST 1000
#define MAX_MSS (9 * 1024)
#define MAX_STREAMS 128
Expand Down
2 changes: 1 addition & 1 deletion src/iperf_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
break;
case 'O':
test->omit = atoi(optarg);
if (test->omit < 0 || test->omit > MAX_TIME) {
if (test->omit < 0 || test->omit > MAX_OMIT_TIME) {
i_errno = IEOMIT;
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/iperf_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ iperf_strerror(int int_errno)
snprintf(errstr, len, "this OS does not support sendfile");
break;
case IEOMIT:
snprintf(errstr, len, "bogus value for --omit");
snprintf(errstr, len, "bogus value for --omit (maximum = %d seconds)", MAX_OMIT_TIME);
break;
case IEUNIMP:
snprintf(errstr, len, "an option you are trying to set is not implemented yet");
Expand Down

0 comments on commit e03c2cc

Please sign in to comment.