summaryrefslogtreecommitdiff
path: root/sbin/pfctl/pfctl.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-06-03 12:18:58 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-06-03 12:18:58 +0000
commit19f706d21a74cb53b6584d41e65ec10f20ef940e (patch)
tree905b7083e2f0f206281df5bda23b04f4dd0555a3 /sbin/pfctl/pfctl.c
parent852f407794d9f047e36e18df159cf35887f981a9 (diff)
process show options before ruleset reload
Diffstat (limited to 'sbin/pfctl/pfctl.c')
-rw-r--r--sbin/pfctl/pfctl.c92
1 files changed, 46 insertions, 46 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 683144df198..88c4afe5183 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.175 2003/05/19 02:32:47 henning Exp $ */
+/* $OpenBSD: pfctl.c,v 1.176 2003/06/03 12:18:57 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1460,51 +1460,6 @@ main(int argc, char *argv[])
if (pfctl_disable(dev, opts))
error = 1;
- if (clearopt != NULL) {
- switch (*clearopt) {
- case 'r':
- pfctl_clear_rules(dev, opts, anchorname, rulesetname);
- break;
- case 'n':
- pfctl_clear_nat(dev, opts, anchorname, rulesetname);
- break;
- case 'q':
- pfctl_clear_altq(dev, opts);
- break;
- case 's':
- pfctl_clear_states(dev, opts);
- break;
- case 'i':
- pfctl_clear_stats(dev, opts);
- break;
- case 'a':
- pfctl_clear_rules(dev, opts, anchorname, rulesetname);
- pfctl_clear_nat(dev, opts, anchorname, rulesetname);
- pfctl_clear_altq(dev, opts);
- pfctl_clear_states(dev, opts);
- pfctl_clear_stats(dev, opts);
- pfctl_clear_tables(anchorname, rulesetname, opts);
- break;
- case 'T':
- pfctl_clear_tables(anchorname, rulesetname, opts);
- break;
- default:
- assert(0);
- }
- }
- if (state_killers)
- pfctl_kill_states(dev, opts);
-
- if (tblcmdopt != NULL) {
- error = pfctl_command_tables(argc, argv, tableopt,
- tblcmdopt, rulesopt, anchorname, rulesetname, opts);
- rulesopt = NULL;
- }
-
- if (rulesopt != NULL)
- if (pfctl_rules(dev, rulesopt, opts, anchorname, rulesetname))
- error = 1;
-
if (showopt != NULL) {
switch (*showopt) {
case 'A':
@@ -1556,6 +1511,51 @@ main(int argc, char *argv[])
}
}
+ if (clearopt != NULL) {
+ switch (*clearopt) {
+ case 'r':
+ pfctl_clear_rules(dev, opts, anchorname, rulesetname);
+ break;
+ case 'n':
+ pfctl_clear_nat(dev, opts, anchorname, rulesetname);
+ break;
+ case 'q':
+ pfctl_clear_altq(dev, opts);
+ break;
+ case 's':
+ pfctl_clear_states(dev, opts);
+ break;
+ case 'i':
+ pfctl_clear_stats(dev, opts);
+ break;
+ case 'a':
+ pfctl_clear_rules(dev, opts, anchorname, rulesetname);
+ pfctl_clear_nat(dev, opts, anchorname, rulesetname);
+ pfctl_clear_altq(dev, opts);
+ pfctl_clear_states(dev, opts);
+ pfctl_clear_stats(dev, opts);
+ pfctl_clear_tables(anchorname, rulesetname, opts);
+ break;
+ case 'T':
+ pfctl_clear_tables(anchorname, rulesetname, opts);
+ break;
+ default:
+ assert(0);
+ }
+ }
+ if (state_killers)
+ pfctl_kill_states(dev, opts);
+
+ if (tblcmdopt != NULL) {
+ error = pfctl_command_tables(argc, argv, tableopt,
+ tblcmdopt, rulesopt, anchorname, rulesetname, opts);
+ rulesopt = NULL;
+ }
+
+ if (rulesopt != NULL)
+ if (pfctl_rules(dev, rulesopt, opts, anchorname, rulesetname))
+ error = 1;
+
if (opts & PF_OPT_ENABLE)
if (pfctl_enable(dev, opts))
error = 1;