From 54ea3ede85dc9063bb860d6bbc78d0ae1a1ce142 Mon Sep 17 00:00:00 2001 From: tye1 Date: Fri, 28 Oct 2011 07:27:48 +0000 Subject: [PATCH] 1. Update error handling code if failing attach socket with new PCB. 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 | 4 ++-- MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c index f512e4eacf..d17bfa8b9d 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c @@ -1,7 +1,7 @@ /** @file Interface function of the Socket. -Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
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 @@ -237,6 +237,7 @@ SockCreateChild ( // with a new protocol control block // Status = Sock->ProtoHandler (Sock, SOCK_ATTACH, NULL); + EfiReleaseLock (&(Sock->Lock)); if (EFI_ERROR (Status)) { DEBUG ((EFI_D_ERROR, "SockCreateChild: Protocol failed to" @@ -246,7 +247,6 @@ SockCreateChild ( Sock = NULL; } - EfiReleaseLock (&(Sock->Lock)); return Sock; } diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c index 536a16a16c..f86e5c2630 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c @@ -1,7 +1,7 @@ /** @file Tcp request dispatcher implementation. -Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
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 @@ -243,6 +243,7 @@ Tcp4FlushPcb ( NetbufFreeList (&Tcb->SndQue); NetbufFreeList (&Tcb->RcvQue); + Tcb->State = TCP_CLOSED; } /** -- 2.39.5