]> git.proxmox.com Git - mirror_edk2.git/commitdiff
The patch acknowledges the TCP zero window probe message, either the format with...
authortye1 <tye1@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 27 Aug 2010 07:57:45 +0000 (07:57 +0000)
committertye1 <tye1@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 27 Aug 2010 07:57:45 +0000 (07:57 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10831 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Timer.c

index 549601eefe41b92152dca889f8785644402e2647..f8dcc365e30c4987fe7635d89a1ff7efb48b394f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   TCP input process routines.\r
 \r
 /** @file\r
   TCP input process routines.\r
 \r
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -33,7 +33,7 @@ TcpSeqAcceptable (
   )\r
 {\r
   return (TCP_SEQ_LEQ (Tcb->RcvWl2, Seg->End) &&\r
   )\r
 {\r
   return (TCP_SEQ_LEQ (Tcb->RcvWl2, Seg->End) &&\r
-          TCP_SEQ_LEQ (Seg->Seq, Tcb->RcvWl2 + Tcb->RcvWnd));\r
+          TCP_SEQ_LT (Seg->Seq, Tcb->RcvWl2 + Tcb->RcvWnd));\r
 }\r
 \r
 \r
 }\r
 \r
 \r
@@ -925,6 +925,14 @@ TcpInput (
   // Process segment in SYN_RCVD or TCP_CONNECTED states\r
   //\r
 \r
   // Process segment in SYN_RCVD or TCP_CONNECTED states\r
   //\r
 \r
+  //\r
+  // Clear probe timer since the RecvWindow is opened.\r
+  //\r
+  if (Tcb->ProbeTimerOn && (Seg->Wnd != 0)) {\r
+    TcpClearTimer (Tcb, TCP_TIMER_PROBE);\r
+    Tcb->ProbeTimerOn = FALSE;\r
+  }\r
+\r
   //\r
   // First step: Check whether SEG.SEQ is acceptable\r
   //\r
   //\r
   // First step: Check whether SEG.SEQ is acceptable\r
   //\r
@@ -1281,11 +1289,6 @@ StepSix:
   Tcb->Idle = 0;\r
   TcpSetKeepaliveTimer (Tcb);\r
 \r
   Tcb->Idle = 0;\r
   TcpSetKeepaliveTimer (Tcb);\r
 \r
-  if (TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_PROBE)) {\r
-\r
-    TcpClearTimer (Tcb, TCP_TIMER_PROBE);\r
-  }\r
-\r
   if (TCP_FLG_ON (Seg->Flag, TCP_FLG_URG) &&\r
       !TCP_FIN_RCVD (Tcb->State)) {\r
 \r
   if (TCP_FLG_ON (Seg->Flag, TCP_FLG_URG) &&\r
       !TCP_FIN_RCVD (Tcb->State)) {\r
 \r
index afcaba4ed6829a9bf9aca82cb863ed7874dfa822..62c8e5b5ace3196838c5b838544de2de1c2e2ac4 100644 (file)
@@ -77,7 +77,9 @@ TcpInitTcbLocal (
   //\r
   // First window size is never scaled\r
   //\r
   //\r
   // First window size is never scaled\r
   //\r
-  Tcb->RcvWndScale = 0;\r
+  Tcb->RcvWndScale  = 0;\r
+\r
+  Tcb->ProbeTimerOn = FALSE;\r
 }\r
 \r
 \r
 }\r
 \r
 \r
index 6e08ac9cdb64bd44f4900af6beb1433d61c849a5..095030551dade07164c7273fa1ac7ba57c843d27 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   TCP output process routines.\r
     \r
 /** @file\r
   TCP output process routines.\r
     \r
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -267,7 +267,9 @@ SetPersistTimer:
       Tcb)\r
       );\r
 \r
       Tcb)\r
       );\r
 \r
-    TcpSetProbeTimer (Tcb);\r
+    if (!Tcb->ProbeTimerOn) {\r
+      TcpSetProbeTimer (Tcb);\r
+    }\r
   }\r
 \r
   return 0;\r
   }\r
 \r
   return 0;\r
index 5759b6b7dd7bffcfe20317073df0814e641a230b..01d6034b13c5657d6406387c605aa6cf1d1fbb3f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Tcp Protocol header file.\r
 \r
 /** @file\r
   Tcp Protocol header file.\r
 \r
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -206,6 +206,7 @@ struct _TCP_CB {
   INT32             NextExpire;  ///< Count down offset for the nearest timer\r
   UINT32            Idle;        ///< How long the connection is in idle\r
   UINT32            ProbeTime;   ///< The time out value for current window prober\r
   INT32             NextExpire;  ///< Count down offset for the nearest timer\r
   UINT32            Idle;        ///< How long the connection is in idle\r
   UINT32            ProbeTime;   ///< The time out value for current window prober\r
+  BOOLEAN           ProbeTimerOn;///< If TRUE, the probe time is on.\r
 \r
   //\r
   // RFC1323 defined variables, about window scale,\r
 \r
   //\r
   // RFC1323 defined variables, about window scale,\r
index 86f47ede98e82f73488e341f715f33c1d7f17ec0..a8e4a933cfd62452c5a1865bde03ca7ab872c7cd 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   TCP timer related functions.\r
     \r
 /** @file\r
   TCP timer related functions.\r
     \r
-Copyright (c) 2005 - 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -212,6 +212,7 @@ TcpProbeTimeout (
   if ((TcpDataToSend (Tcb, 1) != 0) && (TcpToSendData (Tcb, 1) > 0)) {\r
 \r
     ASSERT (TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_REXMIT) != 0);\r
   if ((TcpDataToSend (Tcb, 1) != 0) && (TcpToSendData (Tcb, 1) > 0)) {\r
 \r
     ASSERT (TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_REXMIT) != 0);\r
+    Tcb->ProbeTimerOn = FALSE;\r
     return ;\r
   }\r
 \r
     return ;\r
   }\r
 \r
@@ -387,8 +388,9 @@ TcpSetProbeTimer (
   IN OUT TCP_CB *Tcb\r
   )\r
 {\r
   IN OUT TCP_CB *Tcb\r
   )\r
 {\r
-  if (!TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_PROBE)) {\r
-    Tcb->ProbeTime = Tcb->Rto;\r
+  if (!Tcb->ProbeTimerOn) {\r
+    Tcb->ProbeTime    = Tcb->Rto;\r
+    Tcb->ProbeTimerOn = TRUE;\r
 \r
   } else {\r
     Tcb->ProbeTime <<= 1;\r
 \r
   } else {\r
     Tcb->ProbeTime <<= 1;\r