summaryrefslogtreecommitdiff
path: root/sbin/pfctl
diff options
context:
space:
mode:
authorDan Harnett <danh@cvs.openbsd.org>2004-12-29 15:09:31 +0000
committerDan Harnett <danh@cvs.openbsd.org>2004-12-29 15:09:31 +0000
commit89a80221ff22fde92e6a16376f4b411e0831f94d (patch)
treeabfa29b03abb3570aeea7aedb64858453a43fac2 /sbin/pfctl
parent7dbe68f81a7edfe707059ffa9c3e657213021813 (diff)
change last commit so that the test for PF_OPT_NOACTION is actually in
pfctl_clear_interface_flags(). suggested by and ok henning@
Diffstat (limited to 'sbin/pfctl')
-rw-r--r--sbin/pfctl/pfctl.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 19080f940fb..96eecb94667 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.229 2004/12/29 14:21:01 danh Exp $ */
+/* $OpenBSD: pfctl.c,v 1.230 2004/12/29 15:09:30 danh Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -259,13 +259,15 @@ pfctl_clear_interface_flags(int dev, int opts)
{
struct pfioc_iface pi;
- bzero(&pi, sizeof(pi));
- pi.pfiio_flags = PFI_IFLAG_SETABLE_MASK;
+ if ((opts & PF_OPT_NOACTION) == 0) {
+ bzero(&pi, sizeof(pi));
+ pi.pfiio_flags = PFI_IFLAG_SETABLE_MASK;
- if (ioctl(dev, DIOCCLRIFFLAG, &pi))
- err(1, "DIOCCLRIFFLAG");
- if ((opts & PF_OPT_QUIET) == 0)
- fprintf(stderr, "pf: interface flags reset\n");
+ if (ioctl(dev, DIOCCLRIFFLAG, &pi))
+ err(1, "DIOCCLRIFFLAG");
+ if ((opts & PF_OPT_QUIET) == 0)
+ fprintf(stderr, "pf: interface flags reset\n");
+ }
return (0);
}
@@ -1712,8 +1714,7 @@ main(int argc, char *argv[])
rulesopt = NULL;
}
- if ((rulesopt != NULL) && (!*anchorname)
- && (opts & PF_OPT_NOACTION) == 0)
+ if ((rulesopt != NULL) && (!*anchorname))
if (pfctl_clear_interface_flags(dev, opts | PF_OPT_QUIET))
error = 1;