From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Permerror (SPF Permanent Error: More than 10 MX records returned) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=ting.ye@intel.com; receiver=edk2-devel@lists.01.org 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 2678221A1099A for ; Mon, 11 Dec 2017 23:29:07 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2017 23:33:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,394,1508828400"; d="scan'208";a="157975091" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 11 Dec 2017 23:33:44 -0800 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 11 Dec 2017 23:33:44 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 11 Dec 2017 23:33:44 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002; Tue, 12 Dec 2017 15:33:42 +0800 From: "Ye, Ting" To: "Fu, Siyuan" , "edk2-devel@lists.01.org" CC: "Wu, Jiaxin" Thread-Topic: [Patch] MdeModulePkg/TcpIoLib: Cancel TCP token if connect/accept is timeout. Thread-Index: AQHTbZMRS2ri7gJdmke8F+cYOTxvy6M/W5aw Date: Tue, 12 Dec 2017 07:33:42 +0000 Message-ID: References: <20171205063352.17476-1-siyuan.fu@intel.com> In-Reply-To: <20171205063352.17476-1-siyuan.fu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] MdeModulePkg/TcpIoLib: Cancel TCP token if connect/accept is timeout. 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: , X-List-Received-Date: Tue, 12 Dec 2017 07:29:07 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Siyuan, You might need write a log message for this patch, what do you think? Other= s are good to me. Reviewed-by: Ye Ting Best Regards, Ting -----Original Message----- From: Fu Siyuan [mailto:siyuan.fu@intel.com]=20 Sent: Tuesday, December 5, 2017 2:34 PM To: edk2-devel@lists.01.org Cc: Wu, Jiaxin ; Ye, Ting Subject: [Patch] MdeModulePkg/TcpIoLib: Cancel TCP token if connect/accept = is timeout. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan Cc: Wu Jiaxin Cc: Ye Ting --- MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c b/MdeModulePkg/= Library/DxeTcpIoLib/DxeTcpIoLib.c index 17183e1a6c..2e59b680bf 100644 --- a/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c +++ b/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c @@ -2,7 +2,7 @@ This library is used to share code between UEFI network stack modules. It provides the helper routines to access TCP service. =20 -Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made availab= le under the terms and conditions of the BSD License which accompanies thi= s distribution. The full text of the license may be found at
@@ -585,6= +585,11 @@ TcpIoConnect ( } =20 if (!TcpIo->IsConnDone) { + if (TcpIo->TcpVersion =3D=3D TCP_VERSION_4) { + Tcp4->Cancel (Tcp4, &TcpIo->ConnToken.Tcp4Token.CompletionToken); + } else { + Tcp6->Cancel (Tcp6, &TcpIo->ConnToken.Tcp6Token.CompletionToken); + } Status =3D EFI_TIMEOUT; } else { Status =3D TcpIo->ConnToken.Tcp4Token.CompletionToken.Status; @@ -655,6 +660,11 @@ TcpIoAccept ( } =20 if (!TcpIo->IsListenDone) { + if (TcpIo->TcpVersion =3D=3D TCP_VERSION_4) { + Tcp4->Cancel (Tcp4, &TcpIo->ListenToken.Tcp4Token.CompletionToken); + } else { + Tcp6->Cancel (Tcp6, &TcpIo->ListenToken.Tcp6Token.CompletionToken); + } Status =3D EFI_TIMEOUT; } else { Status =3D TcpIo->ListenToken.Tcp4Token.CompletionToken.Status; -- 2.13.0.windows.1