summaryrefslogtreecommitdiff
path: root/sbin/pfctl
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-05-19 02:32:48 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-05-19 02:32:48 +0000
commit722de9933c51fe49bcaece0d12c93f298f4b92e6 (patch)
tree3f74a952713fe450e816f20719332f0dff008299 /sbin/pfctl
parent6f6ab8aa0c27f7bebc033f6d0b481508ddbc907b (diff)
don't print altq en-/disabled - there's no point, you can't turn them on
and off independently. so only complain if there's a real error. ok dhartmei@ pb@ camield@
Diffstat (limited to 'sbin/pfctl')
-rw-r--r--sbin/pfctl/pfctl.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index e106c7c0ed0..683144df198 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.174 2003/05/19 00:54:19 henning Exp $ */
+/* $OpenBSD: pfctl.c,v 1.175 2003/05/19 02:32:47 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -201,16 +201,9 @@ pfctl_enable(int dev, int opts)
if ((opts & PF_OPT_QUIET) == 0)
fprintf(stderr, "pf enabled\n");
- if (altqsupport) {
- if (ioctl(dev, DIOCSTARTALTQ)) {
- if (errno == EEXIST)
- errx(1, "altq already enabled");
- else
- err(1, "DIOCSTARTALTQ");
- }
- if ((opts & PF_OPT_QUIET) == 0)
- fprintf(stderr, "altq enabled\n");
- }
+ if (altqsupport && ioctl(dev, DIOCSTARTALTQ))
+ if (errno != EEXIST)
+ err(1, "DIOCSTARTALTQ");
return (0);
}
@@ -227,16 +220,9 @@ pfctl_disable(int dev, int opts)
if ((opts & PF_OPT_QUIET) == 0)
fprintf(stderr, "pf disabled\n");
- if (altqsupport) {
- if (ioctl(dev, DIOCSTOPALTQ)) {
- if (errno == ENOENT)
- errx(1, "altq not enabled");
- else
+ if (altqsupport && ioctl(dev, DIOCSTOPALTQ))
+ if (errno != ENOENT)
err(1, "DIOCSTOPALTQ");
- }
- if ((opts & PF_OPT_QUIET) == 0)
- fprintf(stderr, "altq disabled\n");
- }
return (0);
}