From nobody Sat Nov 2 08:27:18 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1493361697535998.3548919261433; Thu, 27 Apr 2017 23:41:37 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 66BB021951CAC; Thu, 27 Apr 2017 23:41:36 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id F2F4F2195406F for ; Thu, 27 Apr 2017 23:41:35 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2017 23:41:35 -0700 Received: from shwdeopenpsi116.ccr.corp.intel.com ([10.239.9.5]) by orsmga004.jf.intel.com with ESMTP; 27 Apr 2017 23:41:34 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,387,1488873600"; d="scan'208";a="81666484" From: Zhang Lubo To: edk2-devel@lists.01.org Date: Fri, 28 Apr 2017 14:41:33 +0800 Message-Id: <1493361693-5112-1-git-send-email-lubo.zhang@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [edk2] [patch] NetworkPkg: Fix issue the iSCSI client can not send reset packet. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ye Ting , Fu Siyuan , Wu Jiaxin MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Cc: Wu Jiaxin Cc: Ye Ting Cc: Fu Siyuan Reviewed-by: Wu Jiaxin Reviewed-by: Ye Ting =20 --- NetworkPkg/TcpDxe/SockInterface.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/NetworkPkg/TcpDxe/SockInterface.c b/NetworkPkg/TcpDxe/SockInte= rface.c index b4ba40a..0248cdf 100644 --- a/NetworkPkg/TcpDxe/SockInterface.c +++ b/NetworkPkg/TcpDxe/SockInterface.c @@ -167,22 +167,10 @@ SockDestroyChild ( ProtoData =3D (TCP_PROTO_DATA *) Sock->ProtoReserved; Tcb =3D ProtoData->TcpPcb; =20 ASSERT (Tcb !=3D NULL); =20 - Status =3D 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. // gBS->CloseProtocol ( Tcb->IpInfo->ChildHandle, @@ -224,10 +212,23 @@ SockDestroyChild ( TcpProtocolGuid, SockProtocol, NULL ); =20 + + Status =3D 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 // Status =3D Sock->ProtoHandler (Sock, SOCK_DETACH, NULL); =20 --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel