Module Name: src
Committed By: mrg
Date: Sun Feb 4 08:44:36 UTC 2018
Modified Files:
src/dist/pf/sbin/pfctl: pfctl_altq.c pfctl_optimize.c
Log Message:
fix two issues found by GCC 6.4:
- cbq_compute_idletime() had a fprintf() not in the intended missing {}.
- skip_cmp_dst_addr() compared a vs a instead of a vs b.
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/dist/pf/sbin/pfctl/pfctl_altq.c
cvs rdiff -u -r1.7 -r1.8 src/dist/pf/sbin/pfctl/pfctl_optimize.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/dist/pf/sbin/pfctl/pfctl_altq.c
diff -u src/dist/pf/sbin/pfctl/pfctl_altq.c:1.9 src/dist/pf/sbin/pfctl/pfctl_altq.c:1.10
--- src/dist/pf/sbin/pfctl/pfctl_altq.c:1.9 Mon Mar 1 00:14:08 2010
+++ src/dist/pf/sbin/pfctl/pfctl_altq.c Sun Feb 4 08:44:36 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pfctl_altq.c,v 1.9 2010/03/01 00:14:08 joerg Exp $ */
+/* $NetBSD: pfctl_altq.c,v 1.10 2018/02/04 08:44:36 mrg Exp $ */
/* $OpenBSD: pfctl_altq.c,v 1.92 2007/05/27 05:15:17 claudio Exp $ */
/*
@@ -450,12 +450,13 @@ cbq_compute_idletime(struct pfctl *pf, s
* this causes integer overflow in kernel!
* (bandwidth < 6Kbps when max_pkt_size=1500)
*/
- if (pa->bandwidth != 0 && (pf->opts & PF_OPT_QUIET) == 0)
+ if (pa->bandwidth != 0 && (pf->opts & PF_OPT_QUIET) == 0) {
warnx("queue bandwidth must be larger than %s",
rate2str(ifnsPerByte * (double)opts->maxpktsize /
(double)INT_MAX * (double)pa->ifbandwidth));
fprintf(stderr, "cbq: queue %s is too slow!\n",
pa->qname);
+ }
nsPerByte = (double)(INT_MAX / opts->maxpktsize);
}
Index: src/dist/pf/sbin/pfctl/pfctl_optimize.c
diff -u src/dist/pf/sbin/pfctl/pfctl_optimize.c:1.7 src/dist/pf/sbin/pfctl/pfctl_optimize.c:1.8
--- src/dist/pf/sbin/pfctl/pfctl_optimize.c:1.7 Mon May 30 17:21:07 2016
+++ src/dist/pf/sbin/pfctl/pfctl_optimize.c Sun Feb 4 08:44:36 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pfctl_optimize.c,v 1.7 2016/05/30 17:21:07 dholland Exp $ */
+/* $NetBSD: pfctl_optimize.c,v 1.8 2018/02/04 08:44:36 mrg Exp $ */
/* $OpenBSD: pfctl_optimize.c,v 1.13 2006/10/31 14:17:45 mcbride Exp $ */
/*
@@ -1084,7 +1084,7 @@ skip_cmp_dst_addr(struct pf_rule *a, str
return (0);
case PF_ADDR_DYNIFTL:
if (strcmp(a->dst.addr.v.ifname, b->dst.addr.v.ifname) != 0 ||
- a->dst.addr.iflags != a->dst.addr.iflags ||
+ a->dst.addr.iflags != b->dst.addr.iflags ||
memcmp(&a->dst.addr.v.a.mask, &b->dst.addr.v.a.mask,
sizeof(a->dst.addr.v.a.mask)))
return (1);
@@ -1156,7 +1156,7 @@ skip_cmp_src_addr(struct pf_rule *a, str
return (0);
case PF_ADDR_DYNIFTL:
if (strcmp(a->src.addr.v.ifname, b->src.addr.v.ifname) != 0 ||
- a->src.addr.iflags != a->src.addr.iflags ||
+ a->src.addr.iflags != b->src.addr.iflags ||
memcmp(&a->src.addr.v.a.mask, &b->src.addr.v.a.mask,
sizeof(a->src.addr.v.a.mask)))
return (1);