summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanh <danh@openbsd.org>2004-12-29 15:09:30 +0000
committerdanh <danh@openbsd.org>2004-12-29 15:09:30 +0000
commitb79a6be97aa072c01d0802f6e23f91c8861ad671 (patch)
tree281405658925ea3111a439e978ac3e94a7381f40
parentsync (diff)
downloadwireguard-openbsd-b79a6be97aa072c01d0802f6e23f91c8861ad671.tar.xz
wireguard-openbsd-b79a6be97aa072c01d0802f6e23f91c8861ad671.zip
change last commit so that the test for PF_OPT_NOACTION is actually in
pfctl_clear_interface_flags(). suggested by and ok henning@
-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;