summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2009-01-01 22:50:40 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2009-01-01 22:50:40 +0000
commit26754e7601b3e096ed300b50445933d339ee4dbf (patch)
tree8bef9ec2f14d37496cd5ae33d05783a9ed6fc656 /usr.bin
parent8526c66d3ae45f90a793c581c7f456afee023e35 (diff)
Unclutter 'systate rules' by printing the flags option using the minimal
pf.conf syntax (flags S/SA is implicit). ok henning canacar
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/systat/pftop.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/usr.bin/systat/pftop.c b/usr.bin/systat/pftop.c
index 0847805f06a..d4e63f78b78 100644
--- a/usr.bin/systat/pftop.c
+++ b/usr.bin/systat/pftop.c
@@ -1,4 +1,4 @@
-/* $Id: pftop.c,v 1.7 2008/11/05 15:48:44 canacar Exp $ */
+/* $Id: pftop.c,v 1.8 2009/01/01 22:50:39 mcbride Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar
* Copyright (c) 2001 Daniel Hartmeier
@@ -36,6 +36,7 @@
#include <net/if.h>
#include <netinet/in.h>
+#include <netinet/tcp.h>
#include <netinet/tcp_fsm.h>
#include <net/pfvar.h>
#include <arpa/inet.h>
@@ -1374,11 +1375,16 @@ print_rule(struct pf_rule *pr)
tb_print_ugid(pr->gid.op, pr->gid.gid[0], pr->gid.gid[1],
"group", GID_MAX);
- if (pr->flags || pr->flagset) {
- tbprintf(" flags ");
- tb_print_flags(pr->flags);
- tbprintf("/");
- tb_print_flags(pr->flagset);
+ if (pr->action == PF_PASS &&
+ (pr->proto == 0 || pr->proto == IPPROTO_TCP) &&
+ (pr->flags != TH_SYN || pr->flagset != (TH_SYN | TH_ACK) )) {
+ tbprintf("flags ");
+ if (pr->flags || pr->flagset) {
+ tb_print_flags(pr->flags);
+ tbprintf("/");
+ tb_print_flags(pr->flagset);
+ } else
+ tbprintf("any ");
}
tbprintf(" ");