Fix a bug related to the interworking of T/TCP and window scaling:

when a connection enters the ESTBLS state using T/TCP, then window
scaling wasn't properly handled.  The fix is twofold.

1) When the 3WHS completes, make sure that we update our window
scaling state variables.

2) When setting the `virtual advertized window', then make sure
that we do not try to offer a window that is larger than the maximum
window without scaling (TCP_MAXWIN).

Reviewed by:	davidg
Reported by:	Jerry Chen <chen@Ipsilon.COM>
This commit is contained in:
Andras Olah 1996-01-31 08:22:24 +00:00
parent 128443c87b
commit 07e43e10f8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=13779
2 changed files with 38 additions and 12 deletions

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_input.c 8.12 (Berkeley) 5/24/95
* $Id: tcp_input.c,v 1.33 1995/11/14 20:34:37 phk Exp $
* $Id: tcp_input.c,v 1.34 1995/12/14 09:53:47 phk Exp $
*/
#ifndef TUBA_INCLUDE
@ -707,7 +707,13 @@ findpcb:
tp->t_flags |= (TF_DELACK | TF_NEEDSYN);
else
tp->t_flags |= (TF_ACKNOW | TF_NEEDSYN);
tp->rcv_adv += tp->rcv_wnd;
/*
* Limit the `virtual advertised window' to TCP_MAXWIN
* here. Even if we requested window scaling, it will
* become effective only later when our SYN is acked.
*/
tp->rcv_adv += min(tp->rcv_wnd, TCP_MAXWIN);
tcpstat.tcps_connects++;
soisconnected(so);
tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT;
@ -1283,13 +1289,20 @@ trimthenstep6:
*/
if (tp->t_flags & TF_NEEDSYN) {
/*
* T/TCP: Connection was half-synchronized, and our
* SYN has been ACK'd (so connection is now fully
* synchronized). Go to non-starred state and
* increment snd_una for ACK of SYN.
* T/TCP: Connection was half-synchronized, and our
* SYN has been ACK'd (so connection is now fully
* synchronized). Go to non-starred state,
* increment snd_una for ACK of SYN, and check if
* we can do window scaling.
*/
tp->t_flags &= ~TF_NEEDSYN;
tp->snd_una++;
/* Do window scaling? */
if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) ==
(TF_RCVD_SCALE|TF_REQ_SCALE)) {
tp->snd_scale = tp->requested_s_scale;
tp->rcv_scale = tp->request_r_scale;
}
}
process_ACK:

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_input.c 8.12 (Berkeley) 5/24/95
* $Id: tcp_input.c,v 1.33 1995/11/14 20:34:37 phk Exp $
* $Id: tcp_input.c,v 1.34 1995/12/14 09:53:47 phk Exp $
*/
#ifndef TUBA_INCLUDE
@ -707,7 +707,13 @@ findpcb:
tp->t_flags |= (TF_DELACK | TF_NEEDSYN);
else
tp->t_flags |= (TF_ACKNOW | TF_NEEDSYN);
tp->rcv_adv += tp->rcv_wnd;
/*
* Limit the `virtual advertised window' to TCP_MAXWIN
* here. Even if we requested window scaling, it will
* become effective only later when our SYN is acked.
*/
tp->rcv_adv += min(tp->rcv_wnd, TCP_MAXWIN);
tcpstat.tcps_connects++;
soisconnected(so);
tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT;
@ -1283,13 +1289,20 @@ trimthenstep6:
*/
if (tp->t_flags & TF_NEEDSYN) {
/*
* T/TCP: Connection was half-synchronized, and our
* SYN has been ACK'd (so connection is now fully
* synchronized). Go to non-starred state and
* increment snd_una for ACK of SYN.
* T/TCP: Connection was half-synchronized, and our
* SYN has been ACK'd (so connection is now fully
* synchronized). Go to non-starred state,
* increment snd_una for ACK of SYN, and check if
* we can do window scaling.
*/
tp->t_flags &= ~TF_NEEDSYN;
tp->snd_una++;
/* Do window scaling? */
if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) ==
(TF_RCVD_SCALE|TF_REQ_SCALE)) {
tp->snd_scale = tp->requested_s_scale;
tp->rcv_scale = tp->request_r_scale;
}
}
process_ACK: