From e291c587e0b4010dcdcdbe7a73b2727b7feba333 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 15 Apr 2015 10:47:34 +0200 Subject: [PATCH 1/2] Revert "tools: apply pfaltq_interface_bw.diff" This reverts commit ef2852df3249529a76e250469e21968b90fe87e6. Bubble up the error into core.git, so that we can fix it in a FreeBSD compliant way. Suggested by: ad@ --- sbin/pfctl/pfctl_altq.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c index 514588f646d..3abd2788d94 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 @@ -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); From 5c14f52aa876e332e150ba4f70c78240200c4bbc Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 15 Apr 2015 10:49:15 +0200 Subject: [PATCH 2/2] Revert "tools: apply ip_dstchng_fix.diff" This reverts commit b770fc65cee77b114f765cae2670968afd403c04. Revert this, not in FreeBSD and can't see why it is needed. Suggested by: ad@ --- sys/netinet/ip_input.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index faef928ae5a..a574754adcd 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -504,7 +504,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