summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2013-11-22 18:57:27 +0000
committerglebius <glebius@FreeBSD.org>2013-11-22 18:57:27 +0000
commit70fc5739078fcf3c93832e13be8c0bf7746c17ed (patch)
treebda82aeb49477e8617f7a3f3f21db1af1845a9a3
parent023e2d37dde9097ef1709610c9b9659bab6a1f82 (diff)
downloadFreeBSD-src-70fc5739078fcf3c93832e13be8c0bf7746c17ed.zip
FreeBSD-src-70fc5739078fcf3c93832e13be8c0bf7746c17ed.tar.gz
Fix off by ones when scanning source nodes hash.
Sponsored by: Nginx, Inc.
-rw-r--r--sys/netpfil/pf/pf_ioctl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c
index bfcd47b..dcf0318 100644
--- a/sys/netpfil/pf/pf_ioctl.c
+++ b/sys/netpfil/pf/pf_ioctl.c
@@ -3081,7 +3081,7 @@ DIOCCHANGEADDR_error:
uint32_t i, nr = 0;
if (psn->psn_len == 0) {
- for (i = 0, sh = V_pf_srchash; i < V_pf_srchashmask;
+ for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask;
i++, sh++) {
PF_HASHROW_LOCK(sh);
LIST_FOREACH(n, &sh->nodes, entry)
@@ -3093,7 +3093,7 @@ DIOCCHANGEADDR_error:
}
p = pstore = malloc(psn->psn_len, M_TEMP, M_WAITOK);
- for (i = 0, sh = V_pf_srchash; i < V_pf_srchashmask;
+ for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask;
i++, sh++) {
PF_HASHROW_LOCK(sh);
LIST_FOREACH(n, &sh->nodes, entry) {
@@ -3385,7 +3385,7 @@ pf_clear_srcnodes(struct pf_src_node *n)
if (n == NULL) {
struct pf_srchash *sh;
- for (i = 0, sh = V_pf_srchash; i < V_pf_srchashmask;
+ for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask;
i++, sh++) {
PF_HASHROW_LOCK(sh);
LIST_FOREACH(n, &sh->nodes, entry) {
OpenPOWER on IntegriCloud