tc: man: change man page and comment to confirm to code's behavior.

Since the get_rate() code incorrectly interpreted bare number, the
behavior is not the same as man page and comment described.

We need to change the man page and comment for compatible with the
existing usage by scripts.
This commit is contained in:
Li Wei 2012-07-11 15:56:57 +00:00 committed by Stephen Hemminger
parent 3cde191f60
commit 6cef544b96
2 changed files with 6 additions and 3 deletions

View File

@ -259,6 +259,9 @@ All parameters accept a floating point number, possibly followed by a unit.
.P
Bandwidths or rates can be specified in:
.TP
bps
Bytes per second
.TP
kbps
Kilobytes per second
.TP
@ -271,8 +274,8 @@ Kilobits per second
mbit
Megabits per second
.TP
bps or a bare number
Bytes per second
bit or a bare number
Bits per second
.P
Amounts of data can be specified in:
.TP

View File

@ -153,7 +153,7 @@ int get_rate(unsigned *rate, const char *str)
return -1;
if (*p == '\0') {
*rate = bps / 8.; /* assume bytes/sec */
*rate = bps / 8.; /* assume bits/sec */
return 0;
}