summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordhartmei <dhartmei@openbsd.org>2005-03-06 02:40:08 +0000
committerdhartmei <dhartmei@openbsd.org>2005-03-06 02:40:08 +0000
commit9360d6bc24bdadc04f6369d66250b0e2ebfa2d99 (patch)
tree24651a104fb291b9f1dc8ffc92e1aa648f469e56
parentAlways remember to check snprintf return value for -1. (diff)
downloadwireguard-openbsd-9360d6bc24bdadc04f6369d66250b0e2ebfa2d99.tar.xz
wireguard-openbsd-9360d6bc24bdadc04f6369d66250b0e2ebfa2d99.zip
print "set skip on" with -v in such a way that the output is valid input
syntax, instead of the cryptic hex flags output.
-rw-r--r--sbin/pfctl/parse.y10
-rw-r--r--sbin/pfctl/pfctl.c7
2 files changed, 10 insertions, 7 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index 4487dc9c79e..7b480ba59f5 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.479 2005/02/27 15:08:39 dhartmei Exp $ */
+/* $OpenBSD: parse.y,v 1.480 2005/03/06 02:40:08 dhartmei Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -4510,11 +4510,17 @@ expand_skip_interface(struct node_if *interfaces)
if (!interfaces || (!interfaces->next && !interfaces->not &&
!strcmp(interfaces->ifname, "none"))) {
+ if (pf->opts & PF_OPT_VERBOSE)
+ printf("set skip on none\n");
errs = pfctl_set_interface_flags(pf, "", PFI_IFLAG_SKIP, 0);
return (errs);
}
+ if (pf->opts & PF_OPT_VERBOSE)
+ printf("set skip on {");
LOOP_THROUGH(struct node_if, interface, interfaces,
+ if (pf->opts & PF_OPT_VERBOSE)
+ printf(" %s", interface->ifname);
if (interface->not) {
yyerror("skip on ! <interface> is not supported");
errs++;
@@ -4522,6 +4528,8 @@ expand_skip_interface(struct node_if *interfaces)
errs += pfctl_set_interface_flags(pf,
interface->ifname, PFI_IFLAG_SKIP, 1);
);
+ if (pf->opts & PF_OPT_VERBOSE)
+ printf(" }\n");
FREE_LIST(struct node_if, interfaces);
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index a6dac718f03..1a1527a57b9 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.232 2005/01/06 08:30:22 mcbride Exp $ */
+/* $OpenBSD: pfctl.c,v 1.233 2005/03/06 02:40:08 dhartmei Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1442,11 +1442,6 @@ pfctl_set_interface_flags(struct pfctl *pf, char *ifname, int flags, int how)
err(1, "DIOCSETIFFLAG");
}
}
-
- if (pf->opts & PF_OPT_VERBOSE)
- printf("%s %s:0x%x flags\n", how ? "set" : "clear",
- pi.pfiio_name, pi.pfiio_flags);
-
return (0);
}