]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Update error handling code if failing attach socket with new PCB.
authortye1 <tye1@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 28 Oct 2011 07:27:48 +0000 (07:27 +0000)
committertye1 <tye1@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 28 Oct 2011 07:27:48 +0000 (07:27 +0000)
2. Set TCP state to Tcp4StateClosed after Configure called with NULL.

Signed-off-by: tye
Reviewed-by: xdu2
Reviewed-by: qouyang
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12591 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c

index f512e4eacf33579e84d45ad80127ad9d8e1ae14b..d17bfa8b9d22c7ea1c679ece807597505c5140bc 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Interface function of the Socket.\r
 \r
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2011, 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
@@ -237,6 +237,7 @@ SockCreateChild (
   // with a new protocol control block\r
   //\r
   Status = Sock->ProtoHandler (Sock, SOCK_ATTACH, NULL);\r
+  EfiReleaseLock (&(Sock->Lock));\r
   if (EFI_ERROR (Status)) {\r
 \r
     DEBUG ((EFI_D_ERROR, "SockCreateChild: Protocol failed to"\r
@@ -246,7 +247,6 @@ SockCreateChild (
     Sock = NULL;\r
   }\r
 \r
-  EfiReleaseLock (&(Sock->Lock));\r
   return Sock;\r
 }\r
 \r
index 536a16a16cd02afaf637e09518c324f26a872e74..f86e5c2630bd64c04e23a285c21a0050ab0f6d58 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Tcp request dispatcher implementation.\r
 \r
-Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2011, 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
@@ -243,6 +243,7 @@ Tcp4FlushPcb (
 \r
   NetbufFreeList (&Tcb->SndQue);\r
   NetbufFreeList (&Tcb->RcvQue);\r
+  Tcb->State = TCP_CLOSED;\r
 }\r
 \r
 /**\r