diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2009-11-22 22:34:51 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2009-11-22 22:34:51 +0000 |
commit | 45185d600bccff75c24b3fde89e16836acacd32d (patch) | |
tree | f4192e56dbe3f195b849ce4ef9f54b66a1850d40 /sbin/pfctl/parse.y | |
parent | 6ab5ecb654c7126805dbc40561f2759f83cc00e0 (diff) |
cleanup after the NAT changes. we used to have multiple rulesets (scrub,
NAT, filter). now we only have one. no need for an array any more. simplifies
the code quite a bit.
in the process fix the abuse of PF_RULESET_* by (surprise, isn't it) the
table code.
written at the filesystem hackathon in stockholm, committed from the
hardware hackathon in portugal. ok gcc and jsing
Diffstat (limited to 'sbin/pfctl/parse.y')
-rw-r--r-- | sbin/pfctl/parse.y | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index ee20d3bd532..e3606d331f4 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.574 2009/11/09 14:31:58 jsg Exp $ */ +/* $OpenBSD: parse.y,v 1.575 2009/11/22 22:34:50 henning Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -5425,23 +5425,17 @@ symget(const char *nam) void mv_rules(struct pf_ruleset *src, struct pf_ruleset *dst) { - int i; struct pf_rule *r; - for (i = 0; i < PF_RULESET_MAX; ++i) { - while ((r = TAILQ_FIRST(src->rules[i].active.ptr)) - != NULL) { - TAILQ_REMOVE(src->rules[i].active.ptr, r, entries); - TAILQ_INSERT_TAIL(dst->rules[i].active.ptr, r, entries); - dst->anchor->match++; - } - src->anchor->match = 0; - while ((r = TAILQ_FIRST(src->rules[i].inactive.ptr)) - != NULL) { - TAILQ_REMOVE(src->rules[i].inactive.ptr, r, entries); - TAILQ_INSERT_TAIL(dst->rules[i].inactive.ptr, - r, entries); - } + while ((r = TAILQ_FIRST(src->rules.active.ptr)) != NULL) { + TAILQ_REMOVE(src->rules.active.ptr, r, entries); + TAILQ_INSERT_TAIL(dst->rules.active.ptr, r, entries); + dst->anchor->match++; + } + src->anchor->match = 0; + while ((r = TAILQ_FIRST(src->rules.inactive.ptr)) != NULL) { + TAILQ_REMOVE(src->rules.inactive.ptr, r, entries); + TAILQ_INSERT_TAIL(dst->rules.inactive.ptr, r, entries); } } |