diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c index f36330e7f73..ae566f84df2 100644 --- a/sbin/pfctl/pfctl_altq.c +++ b/sbin/pfctl/pfctl_altq.c @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -241,11 +240,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); diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 8ac6c0e7b41..dea8bee182b 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -499,7 +499,8 @@ tooshort: goto ours; } if (m->m_flags & M_IP_NEXTHOP) { - if (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL) { + dchg = (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL); + if (dchg != 0) { /* * Directly ship the packet on. This allows * forwarding packets originally destined to us