diff options
author | 2015-02-09 19:14:48 +0000 | |
---|---|---|
committer | 2015-02-09 19:14:48 +0000 | |
commit | 5e1fd096cedea4d116066d29e2ba492c6b706857 (patch) | |
tree | 9a6078d7b4ac284f60643ceac50405b1757199dd | |
parent | Expand the IMPLEMENT_ASN1_FUNCTIONS macro so that the code is visible and (diff) | |
download | wireguard-openbsd-5e1fd096cedea4d116066d29e2ba492c6b706857.tar.xz wireguard-openbsd-5e1fd096cedea4d116066d29e2ba492c6b706857.zip |
correctly reset max_win if the SYN-ACK lacks a wscale option. pf
was setting max_win to 0 and discarded retransmitted SYN-ACK segments
without wscale if the original SYN contained a wscale option.
with gerhard@, ok henning@
-rw-r--r-- | sys/net/pf.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index ade98898e65..657b571976b 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.901 2015/02/07 09:15:25 henning Exp $ */ +/* $OpenBSD: pf.c,v 1.902 2015/02/09 19:14:48 markus Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -3836,8 +3836,9 @@ pf_tcp_track_full(struct pf_pdesc *pd, struct pf_state_peer *src, dws = dst->wscale & PF_WSCALE_MASK; } else { /* fixup other window */ - dst->max_win <<= dst->wscale & - PF_WSCALE_MASK; + dst->max_win = MIN(TCP_MAXWIN, + (u_int32_t)dst->max_win << + (dst->wscale & PF_WSCALE_MASK)); /* in case of a retrans SYN|ACK */ dst->wscale = 0; } |