diff options
| author | mrg <mrg@NetBSD.org> | 2018-02-04 08:44:36 +0000 |
|---|---|---|
| committer | mrg <mrg@NetBSD.org> | 2018-02-04 08:44:36 +0000 |
| commit | 71a13816831f1fa40e85ec85521d6b9185cec0b3 (patch) | |
| tree | a9aeb002c93730e5212d3465454d9cec09406d9e /dist | |
| parent | 56165a9ed7039cd55240453c1cf79128ea3c94cc (diff) | |
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 (limited to 'dist')
| -rw-r--r-- | dist/pf/sbin/pfctl/pfctl_altq.c | 5 | ||||
| -rw-r--r-- | dist/pf/sbin/pfctl/pfctl_optimize.c | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/dist/pf/sbin/pfctl/pfctl_altq.c b/dist/pf/sbin/pfctl/pfctl_altq.c index edbbde5bf74..cac57ce3055 100644 --- a/dist/pf/sbin/pfctl/pfctl_altq.c +++ b/dist/pf/sbin/pfctl/pfctl_altq.c @@ -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, struct pf_altq *pa) * 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 --git a/dist/pf/sbin/pfctl/pfctl_optimize.c b/dist/pf/sbin/pfctl/pfctl_optimize.c index a531091cba5..b0ae83b37e1 100644 --- a/dist/pf/sbin/pfctl/pfctl_optimize.c +++ b/dist/pf/sbin/pfctl/pfctl_optimize.c @@ -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, struct pf_rule *b) 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, struct pf_rule *b) 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); |
