Revert "tools: apply pfaltq_interface_bw.diff"

This reverts commit ef2852df32.
Bubble up the error into core.git, so that we can fix it in
a FreeBSD compliant way.

Suggested by: ad@
This commit is contained in:
Franco Fichtner 2015-04-15 10:47:34 +02:00
parent 117b355c01
commit e291c587e0

View file

@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$");
#include <errno.h>
#include <limits.h>
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -265,11 +264,15 @@ eval_pfaltq(struct pfctl *pf, struct pf_altq *pa, struct node_queue_bw *bw,
pa->ifbandwidth = bw->bw_absolute;
else
#ifdef __FreeBSD__
rate = getifspeed(pf->dev, pa->ifname);
if (rate == 0)
rate = IF_Mbps(100);
if ((rate = getifspeed(pf->dev, pa->ifname)) == 0) {
#else
if ((rate = getifspeed(pa->ifname)) == 0) {
#endif
if ((pa->ifbandwidth = eval_bwspec(bw, rate)) == 0)
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)
pa->ifbandwidth = rate;
errors += eval_queue_opts(pa, opts, pa->ifbandwidth);