summaryrefslogtreecommitdiff
path: root/sbin/pfctl
diff options
context:
space:
mode:
authorMike Frantzen <frantzen@cvs.openbsd.org>2001-08-19 17:03:01 +0000
committerMike Frantzen <frantzen@cvs.openbsd.org>2001-08-19 17:03:01 +0000
commitfdeb5fe31ec0e0d3272b8d2139c18f8930b25d60 (patch)
treeed59fe396a26ec76fc78573246618e2af828d8bb /sbin/pfctl
parent3014b26eb2f9604896fa2315ce31278237b578d9 (diff)
Unfuck some TCP state stuff that would drop the SYN|ACK.
Enumerated the TCP states. Here's a mapping new->old tcp states if anyone gives a shit: TCPS_CLOSED 0 TCPS_SYN_SENT 1 TCPS_ESTABLISHED 2 TCPS_CLOSING 3 TCPS_FIN_WAIT_2 4 TCPS_TIME_WAIT 5
Diffstat (limited to 'sbin/pfctl')
-rw-r--r--sbin/pfctl/pfctl_parser.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c
index 61382ed5030..77336b857fc 100644
--- a/sbin/pfctl/pfctl_parser.c
+++ b/sbin/pfctl/pfctl_parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_parser.c,v 1.42 2001/08/18 14:05:56 deraadt Exp $ */
+/* $OpenBSD: pfctl_parser.c,v 1.43 2001/08/19 17:03:00 frantzen Exp $ */
/*
* Copyright (c) 2001, Daniel Hartmeier
@@ -37,6 +37,8 @@
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
+#define TCPSTATES
+#include <netinet/tcp_fsm.h>
#include <net/pfvar.h>
#include <arpa/inet.h>
@@ -423,12 +425,15 @@ print_state(struct pf_state *s)
print_host(&s->ext);
printf("\n");
- printf("\t%u:%u ", src->state, dst->state);
if (s->proto == IPPROTO_TCP) {
+ printf(" %s:%s ", tcpstates[src->state],
+ tcpstates[dst->state]);
print_seq(src);
printf(" ");
print_seq(dst);
printf("\n");
+ } else {
+ printf(" %u:%u ", src->state, dst->state);
}
sec = s->creation % 60;
@@ -436,7 +441,7 @@ print_state(struct pf_state *s)
min = s->creation % 60;
s->creation /= 60;
hrs = s->creation;
- printf("\tage %.2u:%.2u:%.2u", hrs, min, sec);
+ printf(" age %.2u:%.2u:%.2u", hrs, min, sec);
sec = s->expire % 60;
s->expire /= 60;
min = s->expire % 60;