diff options
author | Renato Botelho <renato@netgate.com> | 2015-08-17 13:53:07 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-08-17 13:53:07 -0300 |
commit | 9b3c3fc58b6b3162259b33fc56746f42a48e0301 (patch) | |
tree | b6686484f13c3deeef00356263756b20508822df | |
parent | 689b5417f72add01420332db0de4cc23023cc04a (diff) | |
download | FreeBSD-src-9b3c3fc58b6b3162259b33fc56746f42a48e0301.zip FreeBSD-src-9b3c3fc58b6b3162259b33fc56746f42a48e0301.tar.gz |
Importing pfSense patch pfaltq_interface_bw.diff
-rw-r--r-- | sbin/pfctl/pfctl_altq.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c index 701e1f2..adba457 100644 --- a/sbin/pfctl/pfctl_altq.c +++ b/sbin/pfctl/pfctl_altq.c @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include <errno.h> #include <limits.h> #include <math.h> +#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -256,15 +257,11 @@ eval_pfaltq(struct pfctl *pf, struct pf_altq *pa, struct node_queue_bw *bw, pa->ifbandwidth = bw->bw_absolute; else #ifdef __FreeBSD__ - if ((rate = getifspeed(pf->dev, pa->ifname)) == 0) { -#else - if ((rate = getifspeed(pa->ifname)) == 0) { + rate = getifspeed(pf->dev, pa->ifname); + if (rate == 0) + rate = IF_Mbps(100); #endif - fprintf(stderr, "interface %s does not know its bandwidth, " - "please specify an absolute bandwidth\n", - pa->ifname); - errors++; - } else if ((pa->ifbandwidth = eval_bwspec(bw, rate)) == 0) + if ((pa->ifbandwidth = eval_bwspec(bw, rate)) == 0) pa->ifbandwidth = rate; errors += eval_queue_opts(pa, opts, pa->ifbandwidth); |