summaryrefslogtreecommitdiffstats
path: root/sys/contrib/pf
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2008-08-04 14:42:09 +0000
committermlaier <mlaier@FreeBSD.org>2008-08-04 14:42:09 +0000
commitf262e1ff14f0fd3be77d380f3f1c8d7947f56566 (patch)
treeebcf3756aa8a1f7c3947a2816c91c5bafaba5586 /sys/contrib/pf
parente73d09d9877ecca98e779ecc9270672be252446c (diff)
downloadFreeBSD-src-f262e1ff14f0fd3be77d380f3f1c8d7947f56566.zip
FreeBSD-src-f262e1ff14f0fd3be77d380f3f1c8d7947f56566.tar.gz
Merge state reuse for tcp.
PR: kern/125261 Obtained from: OpenBSD MFC after: 1 week
Diffstat (limited to 'sys/contrib/pf')
-rw-r--r--sys/contrib/pf/net/pf.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/contrib/pf/net/pf.c b/sys/contrib/pf/net/pf.c
index fd8c395..8289c99 100644
--- a/sys/contrib/pf/net/pf.c
+++ b/sys/contrib/pf/net/pf.c
@@ -1,4 +1,5 @@
/* $OpenBSD: pf.c,v 1.527 2007/02/22 15:23:23 pyr Exp $ */
+/* add: $OpenBSD: pf.c,v 1.559 2007/09/18 18:45:59 markus Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -4779,6 +4780,22 @@ pf_test_state_tcp(struct pf_state **state, int direction, struct pfi_kif *kif,
}
}
+ if (((th->th_flags & (TH_SYN|TH_ACK)) == TH_SYN) &&
+ dst->state >= TCPS_FIN_WAIT_2 &&
+ src->state >= TCPS_FIN_WAIT_2) {
+ if (pf_status.debug >= PF_DEBUG_MISC) {
+ printf("pf: state reuse ");
+ pf_print_state(*state);
+ pf_print_flags(th->th_flags);
+ printf("\n");
+ }
+ /* XXX make sure it's the same direction ?? */
+ (*state)->src.state = (*state)->dst.state = TCPS_CLOSED;
+ pf_unlink_state(*state);
+ *state = NULL;
+ return (PF_DROP);
+ }
+
if (src->wscale && dst->wscale && !(th->th_flags & TH_SYN)) {
sws = src->wscale & PF_WSCALE_MASK;
dws = dst->wscale & PF_WSCALE_MASK;
OpenPOWER on IntegriCloud