1
|
diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c
|
2
|
index 58ea61e..9a33c01 100644
|
3
|
--- a/sbin/pfctl/pfctl_altq.c
|
4
|
+++ b/sbin/pfctl/pfctl_altq.c
|
5
|
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
|
6
|
#include <errno.h>
|
7
|
#include <limits.h>
|
8
|
#include <math.h>
|
9
|
+#include <stdint.h>
|
10
|
#include <stdio.h>
|
11
|
#include <stdlib.h>
|
12
|
#include <string.h>
|
13
|
@@ -256,15 +257,11 @@ eval_pfaltq(struct pfctl *pf, struct pf_altq *pa, struct node_queue_bw *bw,
|
14
|
pa->ifbandwidth = bw->bw_absolute;
|
15
|
else
|
16
|
#ifdef __FreeBSD__
|
17
|
- if ((rate = getifspeed(pf->dev, pa->ifname)) == 0) {
|
18
|
-#else
|
19
|
- if ((rate = getifspeed(pa->ifname)) == 0) {
|
20
|
+ rate = getifspeed(pf->dev, pa->ifname);
|
21
|
+ if (rate == 0)
|
22
|
+ rate = IF_Mbps(100);
|
23
|
#endif
|
24
|
- fprintf(stderr, "interface %s does not know its bandwidth, "
|
25
|
- "please specify an absolute bandwidth\n",
|
26
|
- pa->ifname);
|
27
|
- errors++;
|
28
|
- } else if ((pa->ifbandwidth = eval_bwspec(bw, rate)) == 0)
|
29
|
+ if ((pa->ifbandwidth = eval_bwspec(bw, rate)) == 0)
|
30
|
pa->ifbandwidth = rate;
|
31
|
|
32
|
errors += eval_queue_opts(pa, opts, pa->ifbandwidth);
|