diff options
author | 2003-05-19 02:32:47 +0000 | |
---|---|---|
committer | 2003-05-19 02:32:47 +0000 | |
commit | 33225e1ab123efbd1dd8e7cd70d46fd446254f73 (patch) | |
tree | 3a1860cc4146c9f51a1d650c79005d85c5e7dddd | |
parent | Bad switch condition used for SO_DEBUG, ok itojun@ (diff) | |
download | wireguard-openbsd-33225e1ab123efbd1dd8e7cd70d46fd446254f73.tar.xz wireguard-openbsd-33225e1ab123efbd1dd8e7cd70d46fd446254f73.zip |
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@
-rw-r--r-- | sbin/pfctl/pfctl.c | 26 |
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); } |