summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2009-06-17 04:24:02 +0000
committerdlg <dlg@openbsd.org>2009-06-17 04:24:02 +0000
commit0c82a00626b1448ae73e168721fe336d83a4a648 (patch)
treecdcae72d36590589ee8f520920e4c78619a691df
parentRemove __packed from memory structure. No idea what in the wolrd I was (diff)
downloadwireguard-openbsd-0c82a00626b1448ae73e168721fe336d83a4a648.tar.xz
wireguard-openbsd-0c82a00626b1448ae73e168721fe336d83a4a648.zip
do better detection of when we have a better version of the tcp sequence
windows than our peer. this resolves the last of the pfsync traffic storm issues ive been able to produce, and therefore makes it possible to do usable active-active statuful firewalls with pf. lots of testing locally on the production firewalls, also tested by sthen@
-rw-r--r--sys/net/if_pfsync.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c
index 15183d08a7e..8b946dea498 100644
--- a/sys/net/if_pfsync.c
+++ b/sys/net/if_pfsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.c,v 1.126 2009/06/14 00:16:50 dlg Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.127 2009/06/17 04:24:02 dlg Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -856,12 +856,15 @@ pfsync_upd_tcp(struct pf_state *st, struct pfsync_state_peer *src,
if ((st->src.state > src->state &&
(st->src.state < PF_TCPS_PROXY_SRC ||
src->state >= PF_TCPS_PROXY_SRC)) ||
- SEQ_GT(st->src.seqlo, ntohl(src->seqlo)))
+
+ (st->src.state == src->state &&
+ SEQ_GT(st->src.seqlo, ntohl(src->seqlo))))
sync++;
else
pf_state_peer_ntoh(src, &st->src);
- if (st->dst.state > dst->state ||
+ if ((st->dst.state > dst->state) ||
+
(st->dst.state >= TCPS_SYN_SENT &&
SEQ_GT(st->dst.seqlo, ntohl(dst->seqlo))))
sync++;