summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/TcpDxe
diff options
context:
space:
mode:
authorZhang Lubo <lubo.zhang@intel.com>2017-04-28 14:41:33 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2017-05-02 11:11:39 +0800
commit597cf8a19ff426bf5f8c03425c00acbc7ac8dd63 (patch)
tree78b99c26e0cfeb83060ef19ff4c402785e31e3e9 /NetworkPkg/TcpDxe
parente3793f9834fe9dcec6fda53fbe8df76d32c6f2fa (diff)
downloadedk2-597cf8a19ff426bf5f8c03425c00acbc7ac8dd63.tar.gz
edk2-597cf8a19ff426bf5f8c03425c00acbc7ac8dd63.tar.bz2
edk2-597cf8a19ff426bf5f8c03425c00acbc7ac8dd63.zip
NetworkPkg: Fix issue the iSCSI client can not send reset packet.
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 'NetworkPkg/TcpDxe')
-rw-r--r--NetworkPkg/TcpDxe/SockInterface.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/NetworkPkg/TcpDxe/SockInterface.c b/NetworkPkg/TcpDxe/SockInterface.c
index b4ba40afce..0248cdf6ff 100644
--- a/NetworkPkg/TcpDxe/SockInterface.c
+++ b/NetworkPkg/TcpDxe/SockInterface.c
@@ -169,18 +169,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.
//
@@ -226,6 +214,19 @@ 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
//