summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-08-17 13:52:59 -0300
committerRenato Botelho <renato@netgate.com>2015-08-17 13:52:59 -0300
commit35a2f523fc6fe145b5bf688338c41904f7d13a4b (patch)
tree44bf1d06436e44a1268fa1c75d7b7193cf36b4de /sbin
parent5b128f054452e56b96564210c998510e0dd45130 (diff)
downloadFreeBSD-src-35a2f523fc6fe145b5bf688338c41904f7d13a4b.zip
FreeBSD-src-35a2f523fc6fe145b5bf688338c41904f7d13a4b.tar.gz
Importing pfSense patch ipfw_dummynet_bandwidth.diff
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ipfw/dummynet.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/ipfw/dummynet.c b/sbin/ipfw/dummynet.c
index 28dc2c7..c5b5253 100644
--- a/sbin/ipfw/dummynet.c
+++ b/sbin/ipfw/dummynet.c
@@ -538,10 +538,10 @@ read_bandwidth(char *arg, int *bandwidth, char *if_name, int namelen)
if_name[namelen] = '\0';
*bandwidth = 0;
} else { /* read bandwidth value */
- int bw;
+ double bw;
char *end = NULL;
- bw = strtoul(arg, &end, 0);
+ bw = strtod(arg, &end);
if (*end == 'K' || *end == 'k') {
end++;
bw *= 1000;
@@ -557,7 +557,7 @@ read_bandwidth(char *arg, int *bandwidth, char *if_name, int namelen)
if (bw < 0)
errx(EX_DATAERR, "bandwidth too large");
- *bandwidth = bw;
+ *bandwidth = (int)bw;
if (if_name)
if_name[0] = '\0';
}
OpenPOWER on IntegriCloud