summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network/Tcp4Dxe
diff options
context:
space:
mode:
authortye1 <tye1@6f19259b-4bc3-4df7-8a09-765794883524>2010-08-27 07:57:45 +0000
committertye1 <tye1@6f19259b-4bc3-4df7-8a09-765794883524>2010-08-27 07:57:45 +0000
commitac8cca2a4dd777970811fb727c396e2585c2bba1 (patch)
treebb88e55fb68461de5cbd24e916b084beb80e0498 /MdeModulePkg/Universal/Network/Tcp4Dxe
parent8730386e6d669ded738c6f846aa26bf1c96228bf (diff)
downloadedk2-ac8cca2a4dd777970811fb727c396e2585c2bba1.zip
edk2-ac8cca2a4dd777970811fb727c396e2585c2bba1.tar.gz
edk2-ac8cca2a4dd777970811fb727c396e2585c2bba1.tar.bz2
The patch acknowledges the TCP zero window probe message, either the format with 1 byte new data, or no new data. It also increases exponentially the interval between successive probes when performing TCP zero window probe.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10831 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/Tcp4Dxe')
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c17
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c4
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c6
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h3
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Timer.c8
5 files changed, 24 insertions, 14 deletions
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c
index 549601e..f8dcc36 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c
@@ -1,7 +1,7 @@
/** @file
TCP input process routines.
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -33,7 +33,7 @@ TcpSeqAcceptable (
)
{
return (TCP_SEQ_LEQ (Tcb->RcvWl2, Seg->End) &&
- TCP_SEQ_LEQ (Seg->Seq, Tcb->RcvWl2 + Tcb->RcvWnd));
+ TCP_SEQ_LT (Seg->Seq, Tcb->RcvWl2 + Tcb->RcvWnd));
}
@@ -926,6 +926,14 @@ TcpInput (
//
//
+ // Clear probe timer since the RecvWindow is opened.
+ //
+ if (Tcb->ProbeTimerOn && (Seg->Wnd != 0)) {
+ TcpClearTimer (Tcb, TCP_TIMER_PROBE);
+ Tcb->ProbeTimerOn = FALSE;
+ }
+
+ //
// First step: Check whether SEG.SEQ is acceptable
//
if (TcpSeqAcceptable (Tcb, Seg) == 0) {
@@ -1281,11 +1289,6 @@ StepSix:
Tcb->Idle = 0;
TcpSetKeepaliveTimer (Tcb);
- if (TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_PROBE)) {
-
- TcpClearTimer (Tcb, TCP_TIMER_PROBE);
- }
-
if (TCP_FLG_ON (Seg->Flag, TCP_FLG_URG) &&
!TCP_FIN_RCVD (Tcb->State)) {
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c
index afcaba4..62c8e5b 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c
@@ -77,7 +77,9 @@ TcpInitTcbLocal (
//
// First window size is never scaled
//
- Tcb->RcvWndScale = 0;
+ Tcb->RcvWndScale = 0;
+
+ Tcb->ProbeTimerOn = FALSE;
}
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c
index 6e08ac9..0950305 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c
@@ -1,7 +1,7 @@
/** @file
TCP output process routines.
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -267,7 +267,9 @@ SetPersistTimer:
Tcb)
);
- TcpSetProbeTimer (Tcb);
+ if (!Tcb->ProbeTimerOn) {
+ TcpSetProbeTimer (Tcb);
+ }
}
return 0;
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h
index 5759b6b..01d6034 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h
@@ -1,7 +1,7 @@
/** @file
Tcp Protocol header file.
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -206,6 +206,7 @@ struct _TCP_CB {
INT32 NextExpire; ///< Count down offset for the nearest timer
UINT32 Idle; ///< How long the connection is in idle
UINT32 ProbeTime; ///< The time out value for current window prober
+ BOOLEAN ProbeTimerOn;///< If TRUE, the probe time is on.
//
// RFC1323 defined variables, about window scale,
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Timer.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Timer.c
index 86f47ed..a8e4a93 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Timer.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Timer.c
@@ -1,7 +1,7 @@
/** @file
TCP timer related functions.
-Copyright (c) 2005 - 2007, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -212,6 +212,7 @@ TcpProbeTimeout (
if ((TcpDataToSend (Tcb, 1) != 0) && (TcpToSendData (Tcb, 1) > 0)) {
ASSERT (TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_REXMIT) != 0);
+ Tcb->ProbeTimerOn = FALSE;
return ;
}
@@ -387,8 +388,9 @@ TcpSetProbeTimer (
IN OUT TCP_CB *Tcb
)
{
- if (!TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_PROBE)) {
- Tcb->ProbeTime = Tcb->Rto;
+ if (!Tcb->ProbeTimerOn) {
+ Tcb->ProbeTime = Tcb->Rto;
+ Tcb->ProbeTimerOn = TRUE;
} else {
Tcb->ProbeTime <<= 1;