From: Li Wei <lw@cn.fujitsu.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: netdev <netdev@vger.kernel.org>
Subject: [PATCH] tc: man: change man page and comment to confirm to code's behavior.
Date: Thu, 12 Jul 2012 09:56:57 +0800 [thread overview]
Message-ID: <4FFE2EE9.8030808@cn.fujitsu.com> (raw)
In-Reply-To: <20120711075129.4f81eea8@nehalam.linuxnetplumber.net>
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(-)
diff --git a/man/man8/tc.8 b/man/man8/tc.8
index 958ab98..f0e5613 100644
--- a/man/man8/tc.8
+++ b/man/man8/tc.8
@@ -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
diff --git a/tc/tc_util.c b/tc/tc_util.c
index 926ed08..ccf8fa4 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -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;
}
--
1.7.1
next prev parent reply other threads:[~2012-07-12 1:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-11 7:24 [PATCH] tc_util: fix incorrect bare number process in get_rate Li Wei
2012-07-11 14:51 ` Stephen Hemminger
2012-07-12 1:16 ` Li Wei
2012-07-12 1:56 ` Li Wei [this message]
2012-07-12 16:06 ` [PATCH] tc: man: change man page and comment to confirm to code's behavior Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FFE2EE9.8030808@cn.fujitsu.com \
--to=lw@cn.fujitsu.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.