summaryrefslogtreecommitdiff
path: root/sbin/pfctl/pfctl.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2007-04-21 14:49:46 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2007-04-21 14:49:46 +0000
commit4dd9cc8538303a45dfc00a0ce1400f4fed98788b (patch)
treebf3f4e466947039c61da73599a207a319d1287d2 /sbin/pfctl/pfctl.c
parenta1c46bf132cdbcbb027dd7577ebbc2169f0f8a37 (diff)
fix -o handling. syntax is now -o none|basic|profile. -o without argument
is invalid now, it doesn't serve any purpose any more anyway since that is the default. ok mcbride
Diffstat (limited to 'sbin/pfctl/pfctl.c')
-rw-r--r--sbin/pfctl/pfctl.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 40d03e0344b..b87bb0b2eb5 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.264 2007/04/20 07:30:16 jmc Exp $ */
+/* $OpenBSD: pfctl.c,v 1.265 2007/04/21 14:49:45 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -232,7 +232,7 @@ usage(void)
fprintf(stderr, "[-a anchor] [-D macro=value] [-F modifier]\n");
fprintf(stderr, "\t[-f file] [-i interface] [-K host | network] ");
fprintf(stderr, "[-k host | network]\n");
- fprintf(stderr, "\t[-o[level]] [-p device] [-s modifier]\n");
+ fprintf(stderr, "\t[-o level] [-p device] [-s modifier]\n");
fprintf(stderr, "\t[-t table -T command [address ...]] [-x level]\n");
exit(1);
}
@@ -1963,7 +1963,7 @@ main(int argc, char *argv[])
usage();
while ((ch = getopt(argc, argv,
- "a:AdD:eqf:F:ghi:k:K:mnNOo::p:rRs:t:T:vx:z")) != -1) {
+ "a:AdD:eqf:F:ghi:k:K:mnNOo:p:rRs:t:T:vx:z")) != -1) {
switch (ch) {
case 'a':
anchoropt = optarg;
@@ -2039,24 +2039,11 @@ main(int argc, char *argv[])
loadopt |= PFCTL_FLAG_FILTER;
break;
case 'o':
- if (optarg) {
- optiopt = pfctl_lookup_option(optarg,
- optiopt_list);
- if (optiopt == NULL) {
- warnx("Unknown optimization '%s'",
- optarg);
- usage();
- }
- }
- if (opts & PF_OPT_OPTIMIZE) {
- if (optiopt != NULL) {
- warnx("Cannot specify -o multiple times"
- "with optimizer level");
- usage();
- }
- optimize |= PF_OPTIMIZE_PROFILE;
+ optiopt = pfctl_lookup_option(optarg, optiopt_list);
+ if (optiopt == NULL) {
+ warnx("Unknown optimization '%s'", optarg);
+ usage();
}
- optimize |= PF_OPTIMIZE_BASIC;
opts |= PF_OPT_OPTIMIZE;
break;
case 'O':