netsend uses an arbitrary maximum send rate to reject bogus arguments.

It was previously 1mpps; raise to 10mpps.  While here, get the error
message right.
This commit is contained in:
Robert Watson 2004-09-19 22:57:21 +00:00
parent e8f89940e2
commit 2645c3357d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=135485

View File

@ -47,6 +47,8 @@ usage(void)
exit(-1);
}
#define MAX_RATE 100000000
static __inline void
timespec_add(struct timespec *tsa, struct timespec *tsb)
{
@ -178,8 +180,8 @@ main(int argc, char *argv[])
rate = strtoul(argv[4], &dummy, 10);
if (rate < 1 || *dummy != '\0')
usage();
if (rate > 1000000) {
fprintf(stderr, "rate > 100000\n");
if (rate > MAX_RATE) {
fprintf(stderr, "rate > %d\n", MAX_RATE);
return (-1);
}