summaryrefslogtreecommitdiff
path: root/sys/net/pf_ioctl.c
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2002-12-23 13:15:19 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2002-12-23 13:15:19 +0000
commit94c678fa55186ce490ebdf0dfc8175c1af8b65fc (patch)
tree1cbb0e87721e62f7c8aea66ac6e22190ed07f08f /sys/net/pf_ioctl.c
parentb17d0a09f3306df1ee6cf163520c4662cbdeeeb1 (diff)
Change from array to single pf_pabuf (no longer need multiple buffers as
we don't need the second list of addresses for DIOCCHANGE* operations) Also get rid of a bug where DIOCBEGINADDRS clears pabuf[1] when pabuf[0] is the one being used. ok henning@ dhartmei@
Diffstat (limited to 'sys/net/pf_ioctl.c')
-rw-r--r--sys/net/pf_ioctl.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c
index 3bb27e06710..ec8e2456180 100644
--- a/sys/net/pf_ioctl.c
+++ b/sys/net/pf_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_ioctl.c,v 1.30 2002/12/19 16:25:51 dhartmei Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.31 2002/12/23 13:15:18 mcbride Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -109,8 +109,7 @@ pfattach(int num)
pf_init_ruleset(&pf_main_ruleset);
TAILQ_INIT(&pf_altqs[0]);
TAILQ_INIT(&pf_altqs[1]);
- TAILQ_INIT(&pf_pabuf[0]);
- TAILQ_INIT(&pf_pabuf[1]);
+ TAILQ_INIT(&pf_pabuf);
pf_altqs_active = &pf_altqs[0];
pf_altqs_inactive = &pf_altqs[1];
@@ -576,7 +575,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
pf_rm_rule(NULL, rule);
break;
}
- pf_mv_pool(&pf_pabuf[0], &rule->rpool.list);
+ pf_mv_pool(&pf_pabuf, &rule->rpool.list);
rule->rpool.cur = TAILQ_FIRST(&rule->rpool.list);
rule->evaluations = rule->packets = rule->bytes = 0;
TAILQ_INSERT_TAIL(ruleset->rules[rs_num].inactive.ptr,
@@ -771,11 +770,11 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
pf_rm_rule(NULL, newrule);
break;
}
- pf_mv_pool(&pf_pabuf[0], &newrule->rpool.list);
+ pf_mv_pool(&pf_pabuf, &newrule->rpool.list);
newrule->evaluations = newrule->packets = 0;
newrule->bytes = 0;
}
- pf_empty_pool(&pf_pabuf[0]);
+ pf_empty_pool(&pf_pabuf);
s = splsoftnet();
@@ -1404,7 +1403,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
case DIOCBEGINADDRS: {
struct pfioc_pooladdr *pp = (struct pfioc_pooladdr *)addr;
- pf_empty_pool(&pf_pabuf[1]);
+ pf_empty_pool(&pf_pabuf);
pp->ticket = ++ticket_pabuf;
break;
}
@@ -1444,7 +1443,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
error = EINVAL;
break;
}
- TAILQ_INSERT_TAIL(&pf_pabuf[0], pa, entries);
+ TAILQ_INSERT_TAIL(&pf_pabuf, pa, entries);
break;
}