]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix issue that TCP server will not response to SYN packet from TCP client in TCP6...
authortye1 <tye1@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 10 Aug 2012 06:32:15 +0000 (06:32 +0000)
committertye1 <tye1@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 10 Aug 2012 06:32:15 +0000 (06:32 +0000)
Signed-off-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Ouyang Qian <qian.ouyang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13606 6f19259b-4bc3-4df7-8a09-765794883524

NetworkPkg/TcpDxe/TcpDispatcher.c
NetworkPkg/TcpDxe/TcpIo.c
NetworkPkg/TcpDxe/TcpProto.h

index eaa75a4ec49f7d578d1d25af2bb2530571c0f44a..3e6d34c63f81873c4e3e2e126acd6c4f7a0d6f13 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The implementation of a dispatch routine for processing TCP requests.\r
 \r
 /** @file\r
   The implementation of a dispatch routine for processing TCP requests.\r
 \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -334,6 +334,7 @@ TcpFlushPcb (
   NetbufFreeList (&Tcb->SndQue);\r
   NetbufFreeList (&Tcb->RcvQue);\r
   Tcb->State = TCP_CLOSED;\r
   NetbufFreeList (&Tcb->SndQue);\r
   NetbufFreeList (&Tcb->RcvQue);\r
   Tcb->State = TCP_CLOSED;\r
+  Tcb->RemoteIpZero = FALSE;\r
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
@@ -711,6 +712,10 @@ TcpConfigurePcb (
 \r
   if (Sk->IpVersion == IP_VERSION_6) {\r
     Tcb->Tick          = TCP6_REFRESH_NEIGHBOR_TICK;\r
 \r
   if (Sk->IpVersion == IP_VERSION_6) {\r
     Tcb->Tick          = TCP6_REFRESH_NEIGHBOR_TICK;\r
+\r
+    if (NetIp6IsUnspecifiedAddr (&Tcb->RemoteEnd.Ip.v6)) {\r
+      Tcb->RemoteIpZero = TRUE;\r
+    }\r
   }\r
 \r
   TcpInsertTcb (Tcb);\r
   }\r
 \r
   TcpInsertTcb (Tcb);\r
index cecb6d19c52ceaa9e524c35ed9fc4ccc354e8a9a..2b99927ec54dca55de21844126dd1ee8c308b86a 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implementation of I/O interfaces between TCP and IpIoLib.\r
 \r
 /** @file\r
   Implementation of I/O interfaces between TCP and IpIoLib.\r
 \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -112,7 +112,9 @@ TcpSendIpPacket (
       // It's IPv6 and this TCP segment belongs to a solid TCB, in such case\r
       // the destination address can't be overridden, so reset the Dest to NULL.\r
       //\r
       // It's IPv6 and this TCP segment belongs to a solid TCB, in such case\r
       // the destination address can't be overridden, so reset the Dest to NULL.\r
       //\r
-      Dest = NULL;\r
+      if (!Tcb->RemoteIpZero) {\r
+        Dest = NULL;\r
+      }\r
     }\r
   }\r
 \r
     }\r
   }\r
 \r
index 88dfbb9d5c01fc65f311cefb6b95e87048d30a54..ee351348339e0b7919bbe1fa89693c28cee8d884 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   TCP protocol header file.\r
 \r
 /** @file\r
   TCP protocol header file.\r
 \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -335,6 +335,8 @@ struct _TCP_CONTROL_BLOCK {
   UINT8             Ttl;\r
   EFI_IPv4_ADDRESS  SubnetMask;\r
 \r
   UINT8             Ttl;\r
   EFI_IPv4_ADDRESS  SubnetMask;\r
 \r
+\r
+  BOOLEAN           RemoteIpZero;   ///< RemoteEnd.Ip is ZERO when configured.\r
   IP_IO_IP_INFO     *IpInfo;        ///< Pointer reference to Ip used to send pkt\r
   UINT32            Tick;           ///< 1 tick = 200ms\r
 };\r
   IP_IO_IP_INFO     *IpInfo;        ///< Pointer reference to Ip used to send pkt\r
   UINT32            Tick;           ///< 1 tick = 200ms\r
 };\r