As the comment and manpage indicated that the bare number means
bytes per second, so the division is not needed.
---
tc/tc_util.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
From: Stephen Hemminger <hidden> Date: 2012-07-11 14:51:47
On Wed, 11 Jul 2012 15:24:50 +0800
Li Wei [off-list ref] wrote:
quoted hunk
As the comment and manpage indicated that the bare number means
bytes per second, so the division is not needed.
---
tc/tc_util.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
Thanks for finding this. The documentation, code and comment do
all need to be the same!
But changing the code as you propose would break existing usage
by scripts. Instead, the man page and comment need to change
to match the reality of the existing application.
On Wed, 11 Jul 2012 15:24:50 +0800
Li Wei [off-list ref] wrote:
quoted
As the comment and manpage indicated that the bare number means
bytes per second, so the division is not needed.
---
tc/tc_util.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
Thanks for finding this. The documentation, code and comment do
all need to be the same!
But changing the code as you propose would break existing usage
by scripts. Instead, the man page and comment need to change
to match the reality of the existing application.
Well, I see, I'll send another patch to take care of this.
Thanks,
Wei
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.
---
man/man8/tc.8 | 7 +++++--
tc/tc_util.c | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)
@@ -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
From: Stephen Hemminger <hidden> Date: 2012-07-12 16:06:38
On Thu, 12 Jul 2012 09:56:57 +0800
Li Wei [off-list ref] wrote:
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.
---
man/man8/tc.8 | 7 +++++--
tc/tc_util.c | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)