aboutsummaryrefslogtreecommitdiff
path: root/sbin/ipfw
diff options
context:
space:
mode:
authorEmmanuel Vadot <manu@FreeBSD.org>2017-06-23 14:00:28 +0000
committerEmmanuel Vadot <manu@FreeBSD.org>2017-06-23 14:00:28 +0000
commita61847217d5fd3b587869beaff9b31e117fec90a (patch)
tree7303f757b5911f00b24fbd9aad96be9dbc3ddbb0 /sbin/ipfw
parentb55666926965ddc3dff7099087062606b1156bee (diff)
downloadsrc-a61847217d5fd3b587869beaff9b31e117fec90a.tar.gz
src-a61847217d5fd3b587869beaff9b31e117fec90a.zip
Notes
Diffstat (limited to 'sbin/ipfw')
-rw-r--r--sbin/ipfw/dummynet.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sbin/ipfw/dummynet.c b/sbin/ipfw/dummynet.c
index b069679ce77b..0aa3bb5c1e3a 100644
--- a/sbin/ipfw/dummynet.c
+++ b/sbin/ipfw/dummynet.c
@@ -626,6 +626,8 @@ list_pipes(struct dn_id *oid, struct dn_id *end)
/* data rate */
if (b == 0)
sprintf(bwbuf, "unlimited ");
+ else if (b >= 1000000000)
+ sprintf(bwbuf, "%7.3f Gbit/s", b/1000000000);
else if (b >= 1000000)
sprintf(bwbuf, "%7.3f Mbit/s", b/1000000);
else if (b >= 1000)
@@ -818,6 +820,9 @@ read_bandwidth(char *arg, int *bandwidth, char *if_name, int namelen)
} else if (*end == 'M' || *end == 'm') {
end++;
bw *= 1000000;
+ } else if (*end == 'G' || *end == 'g') {
+ end++;
+ bw *= 1000000000;
}
if ((*end == 'B' &&
_substrcmp2(end, "Bi", "Bit/s") != 0) ||