Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/dist/pf/sbin/pfctl fix two issues found by GCC 6.4:
details: https://anonhg.NetBSD.org/src/rev/1f12a8e0dcca
branches: trunk
changeset: 359193:1f12a8e0dcca
user: mrg <mrg%NetBSD.org@localhost>
date: Sun Feb 04 08:44:36 2018 +0000
description:
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.
diffstat:
dist/pf/sbin/pfctl/pfctl_altq.c | 5 +++--
dist/pf/sbin/pfctl/pfctl_optimize.c | 6 +++---
2 files changed, 6 insertions(+), 5 deletions(-)
diffs (51 lines):
diff -r b782335c6abc -r 1f12a8e0dcca dist/pf/sbin/pfctl/pfctl_altq.c
--- a/dist/pf/sbin/pfctl/pfctl_altq.c Sun Feb 04 08:20:39 2018 +0000
+++ b/dist/pf/sbin/pfctl/pfctl_altq.c Sun Feb 04 08:44:36 2018 +0000
@@ -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 @@
* 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);
}
diff -r b782335c6abc -r 1f12a8e0dcca dist/pf/sbin/pfctl/pfctl_optimize.c
--- a/dist/pf/sbin/pfctl/pfctl_optimize.c Sun Feb 04 08:20:39 2018 +0000
+++ b/dist/pf/sbin/pfctl/pfctl_optimize.c Sun Feb 04 08:44:36 2018 +0000
@@ -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 @@
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 @@
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);
Home |
Main Index |
Thread Index |
Old Index