Date: Mon, 19 Mar 2018 07:28:54 +0000 (UTC) From: Eitan Adler <eadler@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331194 - stable/11/sbin/ipfw Message-ID: <201803190728.w2J7SsOF017190@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: eadler Date: Mon Mar 19 07:28:54 2018 New Revision: 331194 URL: https://svnweb.freebsd.org/changeset/base/331194 Log: MFC r320268,r320276: ipfw: dummynet: Add 'G' and 'g' suffix for bandwidth configuration/display Modified: stable/11/sbin/ipfw/dummynet.c stable/11/sbin/ipfw/ipfw.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/dummynet.c ============================================================================== --- stable/11/sbin/ipfw/dummynet.c Mon Mar 19 07:08:14 2018 (r331193) +++ stable/11/sbin/ipfw/dummynet.c Mon Mar 19 07:28:54 2018 (r331194) @@ -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_nam } 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) || Modified: stable/11/sbin/ipfw/ipfw.8 ============================================================================== --- stable/11/sbin/ipfw/ipfw.8 Mon Mar 19 07:08:14 2018 (r331193) +++ stable/11/sbin/ipfw/ipfw.8 Mon Mar 19 07:28:54 2018 (r331194) @@ -2499,7 +2499,7 @@ The following parameters can be configured for a pipe: .It Cm bw Ar bandwidth | device Bandwidth, measured in .Sm off -.Op Cm K | M +.Op Cm K | M | G .Brq Cm bit/s | Byte/s . .Sm on .Pp
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803190728.w2J7SsOF017190>