Commit 6cef544b authored by Li Wei's avatar Li Wei Committed by Stephen Hemminger

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.
parent 3cde191f
...@@ -259,6 +259,9 @@ All parameters accept a floating point number, possibly followed by a unit. ...@@ -259,6 +259,9 @@ All parameters accept a floating point number, possibly followed by a unit.
.P .P
Bandwidths or rates can be specified in: Bandwidths or rates can be specified in:
.TP .TP
bps
Bytes per second
.TP
kbps kbps
Kilobytes per second Kilobytes per second
.TP .TP
...@@ -271,8 +274,8 @@ Kilobits per second ...@@ -271,8 +274,8 @@ Kilobits per second
mbit mbit
Megabits per second Megabits per second
.TP .TP
bps or a bare number bit or a bare number
Bytes per second Bits per second
.P .P
Amounts of data can be specified in: Amounts of data can be specified in:
.TP .TP
......
...@@ -153,7 +153,7 @@ int get_rate(unsigned *rate, const char *str) ...@@ -153,7 +153,7 @@ int get_rate(unsigned *rate, const char *str)
return -1; return -1;
if (*p == '\0') { if (*p == '\0') {
*rate = bps / 8.; /* assume bytes/sec */ *rate = bps / 8.; /* assume bits/sec */
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment