diff options
author | Daniel Hartmeier <dhartmei@cvs.openbsd.org> | 2002-05-05 21:40:23 +0000 |
---|---|---|
committer | Daniel Hartmeier <dhartmei@cvs.openbsd.org> | 2002-05-05 21:40:23 +0000 |
commit | b5f2795a8610a214a5157e96d671edabd9b3b5c7 (patch) | |
tree | 1b3b369541094f03b49243b00569c99f39244a6f /sbin | |
parent | df70d51bc6bcedc9fe02c6df25ad71fe65a895e8 (diff) |
Instead of returning a useless kernel space pointer for the rule that
created the state from DIOCGETSTATE(S), return the integer rule number,
Print rule number (if existant) from pfctl -vss. Suggested by Jeff Nathan.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/pfctl/pfctl_parser.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 74eb673a698..84bb987be3a 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_parser.c,v 1.66 2002/04/24 18:10:25 dhartmei Exp $ */ +/* $OpenBSD: pfctl_parser.c,v 1.67 2002/05/05 21:40:22 dhartmei Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -657,7 +657,10 @@ print_state(struct pf_state *s, int opts) s->expire /= 60; hrs = s->expire; printf(", expires in %.2u:%.2u:%.2u", hrs, min, sec); - printf(", %u pkts, %u bytes\n", s->packets, s->bytes); + printf(", %u pkts, %u bytes", s->packets, s->bytes); + if (s->rule.nr != USHRT_MAX) + printf(", rule %u", s->rule.nr); + printf("\n"); } } |