diff options
author | Daniel Hartmeier <dhartmei@cvs.openbsd.org> | 2005-03-06 02:40:09 +0000 |
---|---|---|
committer | Daniel Hartmeier <dhartmei@cvs.openbsd.org> | 2005-03-06 02:40:09 +0000 |
commit | 1cef10f687b0da1a6546c67b3f2c17e48b5d7ecf (patch) | |
tree | b3687a35e8a8a71ad056fdccaf945215365d7b6e /sbin/pfctl | |
parent | 7b4abd7b291ef3bc08f89a2f469fdea0f052f977 (diff) |
print "set skip on" with -v in such a way that the output is valid input
syntax, instead of the cryptic hex flags output.
Diffstat (limited to 'sbin/pfctl')
-rw-r--r-- | sbin/pfctl/parse.y | 10 | ||||
-rw-r--r-- | sbin/pfctl/pfctl.c | 7 |
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); } |