summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal
diff options
context:
space:
mode:
authorZhang, Lubo <lubo.zhang@intel.com>2017-04-28 14:40:49 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2017-05-02 11:09:32 +0800
commite3793f9834fe9dcec6fda53fbe8df76d32c6f2fa (patch)
tree291ca7a2a22566b8746d2ee9a2739e32b0fe5700 /MdeModulePkg/Universal
parent25942a40262083042798b0d92908091343d645e5 (diff)
downloadedk2-e3793f9834fe9dcec6fda53fbe8df76d32c6f2fa.tar.gz
edk2-e3793f9834fe9dcec6fda53fbe8df76d32c6f2fa.tar.bz2
edk2-e3793f9834fe9dcec6fda53fbe8df76d32c6f2fa.zip
MdeModulePkg: Fix issue the iSCSI client can not send reset packet correctly.
if we already established a iSCSI connection from initiator to target based on IPv4 stack, after using reconnect -r command, we can not rebuild the session with the windows target, since the server thought the session is still exist. This issue is caused by wrong place of acquire ownership of sock lock which lead the iSCSI can not reset the connection correctly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
index f8b535cf6e..bca4b02009 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
@@ -162,15 +162,6 @@ SockDestroyChild (
ASSERT (Tcb != NULL);
- Status = EfiAcquireLockOrFail (&(Sock->Lock));
- if (EFI_ERROR (Status)) {
-
- DEBUG ((EFI_D_ERROR, "SockDestroyChild: Get the lock to "
- "access socket failed with %r\n", Status));
-
- return EFI_ACCESS_DENIED;
- }
-
//
// Close the IP protocol.
//
@@ -214,6 +205,15 @@ SockDestroyChild (
NULL
);
+ Status = EfiAcquireLockOrFail (&(Sock->Lock));
+ if (EFI_ERROR (Status)) {
+
+ DEBUG ((EFI_D_ERROR, "SockDestroyChild: Get the lock to "
+ "access socket failed with %r\n", Status));
+
+ return EFI_ACCESS_DENIED;
+ }
+
//
// force protocol layer to detach the PCB
//