summaryrefslogtreecommitdiff
path: root/sbin/pfctl/pfctl.c
diff options
context:
space:
mode:
authorCedric Berger <cedric@cvs.openbsd.org>2003-02-03 14:51:37 +0000
committerCedric Berger <cedric@cvs.openbsd.org>2003-02-03 14:51:37 +0000
commit59bf24a030195c8eb48026e6e0e377501ff16d32 (patch)
tree176cddd7bd51fe8839ddce1f614086a2f3737f5b /sbin/pfctl/pfctl.c
parent48ad9eec217292cf9dd601924866bc402f0c76ac (diff)
remove loadopt global definition and cleanup a bit.
ok henning@
Diffstat (limited to 'sbin/pfctl/pfctl.c')
-rw-r--r--sbin/pfctl/pfctl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 6d67afd7998..4eacf683644 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.144 2003/02/03 13:57:47 henning Exp $ */
+/* $OpenBSD: pfctl.c,v 1.145 2003/02/03 14:51:36 cedric Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -963,7 +963,8 @@ pfctl_rules(int dev, char *filename, int opts)
if (ioctl(dev, DIOCBEGINRULES, &pr[PF_RULESET_FILTER]))
err(1, "DIOCBEGINRULES");
}
- pfctl_begin_table();
+ if (loadopt & (PFCTL_FLAG_TABLE | PFCTL_FLAG_ALL))
+ pfctl_begin_table();
}
/* fill in callback data */
pf.dev = dev;
@@ -1003,7 +1004,8 @@ pfctl_rules(int dev, char *filename, int opts)
if (ioctl(dev, DIOCCOMMITRULES, &pr[PF_RULESET_FILTER]))
err(1, "DIOCCOMMITRULES");
}
- pfctl_commit_table();
+ if (loadopt & (PFCTL_FLAG_TABLE | PFCTL_FLAG_ALL))
+ pfctl_commit_table();
}
if (fin != stdin)
fclose(fin);