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.93; helo=mga11.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 E7BC820945B6A for ; Mon, 11 Dec 2017 22:17:48 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2017 22:22:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,394,1508828400"; d="scan'208";a="11585405" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 11 Dec 2017 22:22:26 -0800 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 11 Dec 2017 22:22:26 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 11 Dec 2017 22:22:26 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by shsmsx102.ccr.corp.intel.com ([169.254.2.175]) with mapi id 14.03.0319.002; Tue, 12 Dec 2017 14:22:24 +0800 From: "Wu, Jiaxin" To: "Fu, Siyuan" , "edk2-devel@lists.01.org" CC: "Ye, Ting" Thread-Topic: [Patch] MdeModulePkg/TcpIoLib: Cancel TCP token if connect/accept is timeout. Thread-Index: AQHTbZMRtNIw683z8kCiKUNuOGvMMKM/R/Qg Date: Tue, 12 Dec 2017 06:22:24 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B7274163529DB@SHSMSX103.ccr.corp.intel.com> References: <20171205063352.17476-1-siyuan.fu@intel.com> In-Reply-To: <20171205063352.17476-1-siyuan.fu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTJkNDA3Y2EtZTBiMi00YWYyLTg0OTUtMjQ3NzkxYjYzMzZjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Im1SdTNkdjNVcFdCdHMxS2Q1eE5JXC9tbjBHTVhpVlZGRkF3WGJJc3dmbGIwPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action 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 06:17:49 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Wu Jiaxin > -----Original Message----- > From: Fu Siyuan [mailto:siyuan.fu@intel.com] > 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. >=20 > 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(-) >=20 > 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 available under the terms and conditions of the BS= D > License > which accompanies this distribution. The full text of the license may b= e > 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