summaryrefslogtreecommitdiff
path: root/NetworkPkg
AgeCommit message (Collapse)Author
2016-08-18NetworkPkg/IpSecDxe: Fix wrong IKE header "FLAG" updateJiaxin Wu
*v2: update the commit log and refine the code comments. There are three kinds of IKE Exchange process: #1. Initial Exchange #2. CREATE_CHILD_SA_Exchange #3. Information Exchange The IKE header "FLAG" update is incorrect in #2 and #3 exchange, which may cause the continue session failure. This patch is used to correct the updates of IKE header "FLAG" according the RFC4306 section 3.1. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
2016-08-18NetworkPkg/IpSecDxe: Fix UEFI IKE Initial Exchange failureJiaxin Wu
*v2: update the commit log. IKE Initial Exchange message should cover below process: Initiator Responder Message1 HDR,SAil,KEi,Ni ------> Message2 <------ HDR,SArl,KEr,Nr,[CERTREQ] Message3 HDR,SK{} ------> Message4 <------ HDR,SK{} If Initial Exchange message is initiated by Linux IKE, it works well. But the failure will happen if it's initiated by UEFI IKE. This issue is caused by the no status check of NotifyCookiePayload. While parsing the IKEv2 packet for IKE_SA_INIT exchange, if the packet doesn't contain COOKIE Notify payload, EFI_INVALID_PARAMETER will be returned from Ikev2ParserNotifyCookiePayload(). Current implementation return this error status directly, then the session will be broken. The correct behavior should check this status. If no COOKIE Notify payload, initiator don't need to retry the IKE_SA_INIT. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
2016-08-18NetworkPkg: Fix assert issue in iSCSI driverZhang Lubo
The bug is caused by using already freed memory. If there is already an attempt and execute 'reconnect -r' command, all the AttemptConfig structure will be freed, but the mCallbackInfo->Current is not configured as null and this pointer will be used again in IScsiFormExtractConfig. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
2016-08-18NetworkPkg: Refine codes of iSCSI driverZhang Lubo
The RSDT is only used when the bios need to support ACPI 1.0 version. When change PcdAcpiExposedTableVersions to 0x3C, it will not support ACPI 1.0. The default is 0x3E. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
2016-08-08NetworkPkg DSC: Add build option to disable deprecated APIsHao Wu
Add the following definition in the [BuildOptions] section in package DSC files to disable APIs that are deprecated: [BuildOptions] *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
2016-08-01NetworkPkg: Add missed character in copyright.Fu Siyuan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
2016-07-26NetworkPkg UefiPxeBcDxe: Fix build error for lastest VS2015 compilerHao Wu
The UefiPxeBcDxe module encounters a build error for IA32 arch using the latest version of VS2015: UefiPxeBcDxe.lib(PxeBcBoot.obj) : error LNK2001: unresolved external symbol __allmul The cause is line 148 in file NetworkPkg\UefiPxeBcDxe\PxeBcBoot.c. The third parameter for gBS->SetTimer() function is of type UINT64, so the multiplication should use the MultU64x32() function now. Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-07-26NetworkPkg IScsiDxe: Fix build error for lastest VS2015 compilerHao Wu
The IScsiDxe module encounters a build error for IA32 arch using the latest version of VS2015: IScsiDxe.lib(IScsiProto.obj) : error LNK2001: unresolved external symbol __allmul The cause is line 141 in file NetworkPkg\IScsiDxe\IScsiProto.c. The third parameter for gBS->SetTimer() function is of type UINT64, so the multiplication should use the MultU64x32() function now. Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-07-22Fix IPv6 HTTPClient vendor class dataMichael Chang
The size of the ClassIdentifier is apparently wrong in the structure. In my testing it caused the vendor class data to be displayed as bogus "HTTPClient:Arch00016x:UNDI00300". After correcting the size the vendor class data is "HTTPClient:Arch00016:UNDI003000" which looks good to me. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Chang <mchang@suse.com> Reviewed-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
2016-07-18NetworkPkg: Fix bug in TCP which not sending out ACK in certain circumstance.Fu Siyuan
Consider the situation as shown in below chart. The last ACK message has acknowledged the Tcb->RcvWl2, and all the segments until Tcb->RcvNxt have been received by TCP driver. The Tcb->RcvNxt is not acknowledged due to the delayed ACK. In this case an incoming segment (Seg->Seq, Seg->End) should not be accepted by TCP driver, and an immediate ACK is required. Current TcpSeqAcceptable() thought it’s an acceptable segment incorrectly, it continues the TcpInput() process instead of sending out an ACK and droping the segment immediately. Tcb->RcvWl2 Tcb->RcvNxt Tcb->RcvWl2 + Tcb->RcvWnd Seg->Seq Seg->End | | | | | | | ---+-----+---------------+-------------+--------------------------+----------- <income segment> <----Acceptable Range--- --> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-By: Eugene Cohen <eugene@hp.com> Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-By: Ye Ting <ting.ye@intel.com>
2016-07-12NetworkPkg: Update PXE driver to follow edk2 coding standards.Fu Siyuan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <smahmoud@lenovo.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
2016-07-11NetworkPkg: Fix Assert issue in iSCSI driver.Zhang, Lubo
The bug existed in replacing AsciiStrToUnicodeStr with AsciiStrToUnicodeStrS, since MacString now is a pointer, the value sizeof(MacString)/sizeof (MacString[0]) is not correct here as the third parameter. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-07-11NetworkPkg: Fix typos in commentsGiri P Mudusuru
- abstrated to abstracted - apropriate to appropriate - availabe to available - ptototypes to prototypes - prococol protocol Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2016-06-30NetworkPkg: fix ASSERT_EFI_ERROR() typosLaszlo Ersek
A number of code locations use ASSERT_EFI_ERROR (BooleanExpression) instead of ASSERT (BooleanExpression) Fix them. Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
2016-06-30NetworkPkg: Stop the HTTP Boot service after the boot image download complete.Fu Siyuan
After boot image has been downloaded, the HTTP boot driver leaves the service in the started state, with an active TCP child. This may cause some problems: 1. The HTTP session may become unavaiable after a while, then a following HTTP Boot will fail. 2. An active TCP child will send RST to any incoming TCP message, which may break other driver which tries to setup a TCP connection. The HTTP boot driver doesn't provide any interface to the boot loader, so it's unnecessary to keep the service running after a boot image is downloaded. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
2016-06-27NetworkPkg: Avoid potential NULL pointer dereferenceJiaxin Wu
The commit of 6b16c9e7 removes ASSERT and use error handling in IpSecDxe driver, but may cause the potential NULL pointer dereference. So, this patch is used to avoid NULL pointer dereference. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
2016-06-23NetworkPkg: Refine codes related to Dhcpv4 and Dhcpv6 configuration.Zhang Lubo
v2: *Since we have redefined the name of arch types in Dhcp.h for http boot, it need to change corresponding codes. Add a new head file Dhcp.h in Mde/Include/IndustryStandard, normalize the universal option numbers and other network number tags. Cc: Sriram Subramanian <sriram-s@hpe.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-06-23NetworkPkg: Replace ASSERT with error handling in Http boot and IScsiZhang Lubo
v2: *Fix some memory leak issue. This patch is used to replace ASSERT with error handling in Http boot Driver and IScsi driver. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
2016-06-21NetworkPkg: Replace ASSERT with error handling in DnsDxeJiaxin Wu
v2: * Use goto to simplify code logic. This patch is used to replace ASSERT with error handling in DnsDxe driver. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-06-21NetworkPkg: Remove ASSERT and use error handling in IpSecDxeJiaxin Wu
This patch is used to refine the code by removing ASSERT and using error handling in IpSecDxe driver. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Cc: Yao Jiewen <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
2016-06-21NetworkPkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStrStar Zeng
It is the follow up of 3ab41b7a325ca11a12b42f5ad1661c4b6791cb49 to replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr with UnicodeStrToAsciiStrS/AsciiStrToUnicodeStrS. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
2016-06-17NetworkPkg: Fix unspecified address use case in IpsecConfigJiaxin Wu
This patch is used to fix unspecified address use case in ConstructSpdIndexer() function. Indexer->Name for ConstructSpdIndexer is unspecified, that will be a problem for UnicodeStrToAsciiStr. This patch also refine the code by removing ASSERT and user error handling. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Zeng Star <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Zeng Star <star.zeng@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-06-14NetworkPkg/TcpDxe: Fix GCC build failureJiaxin Wu
Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-06-13NetworkPkg: Fix DNS GeneralLookUp failure in some caseJiaxin Wu
QClass value may be not equal to 1(DNS_CLASS_INET) when GeneralLookUp query is called. So, remove QClass value check. Moreover, the 'Identification' and 'Type' filed in Query packet should not be changed to little endian since the packet maybe retransmitted while there is any error happened. Cc: Ye Ting <ting.ye@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
2016-06-13NetworkPkg: Remove TokenEntry from Token list before freedJiaxin Wu
TokenEntry should be removed from Token list before freed. Otherwise, invalid TokenEntry will be existed in Token list. Cc: Ye Ting <ting.ye@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
2016-06-13NetworkPkg: Fix IPv6 boot failure in diff net segment issueJiaxin Wu
This patch is used to fix HTTP IPv6 boot failure in diff net segment issue. IPv6 gateway address should be registered before DNS query, otherwise, DNS query will fail. Cc: Ye Ting <ting.ye@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
2016-06-13NetworkPkg: Handling timeout case in httpboot driverJiaxin Wu
This patch is used to handle timeout case when downloading the message. The Status in the token should also be checked to handle any response error case including timeout case. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Cc: Gary Lin <glin@suse.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Gary Lin <glin@suse.com> Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Tested-by: Gary Lin <glin@suse.com> Tested-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
2016-06-13NetworkPkg: HttpDxe response/cancel issue fixJiaxin Wu
Remove timeout check for http body message receive. It should be handled in HttpBootDxe driver for http response unblocking implementation. After timeout removed, the Wrap date should not be freed immediately. Only the TCP CompletionToken in Wrap date is canceled or signaled, the Wrap date could be freed. In addition, Http cancel token is also incorrect. Tcp Cancel should be called to cancel TCP CompletionToken in Wrap date before close it directly. Otherwise, some exception behavior may happened. This patch also refine the coding style for HttpDxe driver. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Cc: Gary Lin <glin@suse.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Gary Lin <glin@suse.com> Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Tested-by: Gary Lin <glin@suse.com> Tested-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
2016-06-13NetworkPkg: Support TCP Cancel functionJiaxin Wu
This path is used to support TCP Cancel function to abort an asynchronous connection, listen, transmission or receive request. If any TCP CompletionToken is not signaled, it should not be closed directly by calling CloseEvent (Still in the TCP TokenList). If not, any exception behavior may be triggered. We should cancel it by calling Tcp->Cancel() first. In such a case, TCP Cancel function is necessary. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Cc: Gary Lin <glin@suse.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Gary Lin <glin@suse.com> Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Tested-by: Gary Lin <glin@suse.com> Tested-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
2016-05-31NetworkPkg: Stop the timer before clean IP service.Fu, Siyuan
In Ip6CleanService()it first cleaned some resources, then stop the timer . While before the timer stopped it may try to access some already freed data, which may generate an exception. This patch updates the driver to stop the timer event before starting to clean up the service data. Cc: Wu Jiaxin <jiaxin.wu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Subramanian Sriram <sriram-s@hpe.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
2016-05-26NetworkPkg: Correct HttpConfigure parameter checkJiaxin Wu
When HttpConfigData is NULL, HttpConfigure should not return EFI_INVALID_PARAMETER. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
2016-05-24NetworkPkg: update code for NULL pointer check.Fu Siyuan
This patch updates the HTTP driver to initialize the local variable for NULL and check the NULL pointer before dereference it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
2016-05-20NetworkPkg/HttpDxe: Don't free Wrap in HttpTcpReceiveNotifyDpcGary Lin
The HTTP Token Wrap is created in EfiHttpResponse() and then passed to the deferred Receive event callback, HttpTcpReceiveNotifyDpc. HttpTcpReceiveHeader and HttpTcpReceiveBody use a Tcp polling loop to monitor the socket status and trigger the Receive event when a new packet arrives. The Receive event brings up HttpTcpReceiveNotifyDpc to process the HTTP message and the function will set Wrap->TcpWrap.IsRxDone to TRUE to break the Tcp polling loop. However, HttpTcpReceiveNotifyDpc mistakenly freed Wrap, so the Tcp polling loop was actually checking a dead variable, and this led the system into an unstable status. Given the fact that the HTTP Token Wrap will be freed in EfiHttpResponse or HttpResponseWorker, this commit removes every "FreePool (Wrap)" in HttpTcpReceiveNotifyDpc. v2: * Free Wrap after HttpTcpReceiveBody returns normally. Cc: "Wu, Jiaxin" <jiaxin.wu@intel.com> Cc: "Siyuan Fu" <siyuan.fu@intel.com> Cc: "El-Haj-Mahmoud, Samer" <samer.el-haj-mahmoud@hpe.com> Cc: "Laszlo Ersek" <lersek@redhat.com> Cc: "Hegde, Nagaraj P" <nagaraj-p.hegde@hpe.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
2016-05-20NetworkPkg/TcpDxe: Remove the status check of SockProcessRcvTokenGary Lin
SockProcessRcvToken only returns the number of the received bytes, not an EFI Status. Cc: "Siyuan Fu" <siyuan.fu@intel.com> Cc: "Jiaxin Wu" <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
2016-05-16NetworkPkg:HttpDxe: Code changes to support HTTP PUT/POST operationsNagaraj Hegde
Code changes enables HttpDxe to handle PUT/POST operations. EfiHttpRequest assumes "Request" and "HttpMsg->Headers" can never be NULL. Also, HttpResponseWorker assumes HTTP Reponse will contain headers. We could have response which could contain only a string (HTTP 100 Continue) and no headers. Code changes tries to do-away from these assumptions, which would enable HttpDxe to support PUT/POST operations. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hegde, Nagaraj P nagaraj-p.hegde@hpe.com Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-05-13NetworkPkg: Make HttpBootGetBootFile return EFI_BUFFER_TOO_SMALLGary Lin
Per the description of HttpBootGetBootFile, the function should return EFI_BUFFER_TOO_SMALL if the given buffer is smaller than the remote image. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-05-12NetworkPkg: Bug fix of iSCSI to support MPIOZhang, Lubo
If two attempts added on different NIC and enable MPIO attribute, then change the attempts order. If both two attempts succeed to connect the target,it should abort the later one in the order and uninstall ExtScsiPassThruProtocol Interface, But now it unistall it twice. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-By: Ye Ting <ting.ye@intel.com> Reviewed-By: Fu Siyuan <siyuan.fu@intel.com> Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
2016-05-06NetworkPkg: Ignore BootFileName if it is overloaded.Fu Siyuan
Make sure "File" field is not overloaded to carry other DHCP options before use it in PXE driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
2016-05-06NetworkPkg: Ignore BootFileName if it is overloaded.Fu Siyuan
Make sure "File" field is not overloaded to carry other DHCP options before use it in HTTP boot driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
2016-05-06NetworkPkg: Fix a memory leak in HTTP boot driver.Fu Siyuan
We always need to call EfiBootManagerFreeLoadOption because the memory allocated for NewOption (description and device path) is no longer needed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com> Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
2016-05-06NetworkPkg/HttpBootDxe: Fix for the issue that the HTTP boot option can't be ↵Sunny Wang
booted more than once This issue can be reproduced by the following steps: 1. Boot to HTTP boot option and the boot file is a ISO file like Ubuntu PE image. 2. Exit from boot option (GRUB) and then back to boot manager menu. 3. Boot to the same HTTP boot option again or a HTTP boot option pointing to the same HTTP ISO file. It will fail to boot. Root cause: When booting a HTTP boot option, the HTTP boot driver will save the Boot File's information in its private data as cache data for skipping the Boot file discovery from next time boot. However, the cache data doesn't include ImageType data, which would cause HTTP boot driver using the invalid ImageType (ImageTypeMax) and then fail to boot the cached boot file. In other words, for the second time boot, the HttpBootLoadFile() doesn't update ImageType (it returns a valid ImageType), which causes that the HttpBootDxeLoadFile() skips to Register a RAM Disk for downloaded HTTP ISO file and then BDS code can't find the RAM disk to boot. Solution: Save ImageType to private data for next time HTTP boot. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Sunny Wang <sunnywang@hpe.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-05-05NetworkPkg: Do not use hard coded TTL/ToS in PXE driver.Fu Siyuan
EFI_PXE_BASE_CODE_PROTOCOL has interface to set the TTL and ToS value, but not used by the UdpWrite() interface. The code always use a hard coded 16 for the TTL and 0 for ToS. This patch update the UpdWrite() to use the TTL and ToS which have been set by the SetParameters(). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-By: Samer El-Haj-Mahmoud <elhaj@hpe.com>
2016-05-05NetworkPkg: Use UefiBootManagerLib API to create load option.Fu Siyuan
This patch updates the HTTP boot driver to use the API in UefiBootManagerLib to create new load option, to avoid duplicate code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: : Ye Ting <ting.ye@intel.com> Reviewed-by: : Ni Ruiyu <ruiyu.ni@intel.com>
2016-04-28NetworkPkg: Fix incorrect buffer free in HttpDxeJiaxin Wu
FragmentBuffer of each TcpWrap in HttpDxe should not be freed in HttpTcpTokenCleanup(). This buffer points to HttpMsg body actually, which is the responsibility of the caller to allocate a buffer for Body. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
2016-04-28NetworkPkg: Avoid the indefinite wait case in HttpDxeJiaxin Wu
Need the timer check to avoid the indefinite wait case in HttpDxe driver A.HTTP receive Header process in HttpTcpReceiveHeader(); B.HTTP receive Body process in HttpTcpReceiveBody(); Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-04-27NetworkPkg:HttpDxe:Consume DxeHttpLib API changesNagaraj Hegde
HttpGenRequestString is updated to HttpGenRequestMessage, with an additional argument. This patch updates the caller of the DxeHttpLib API. Also, we will avoid adding any '\0' to the string, which was added to make AsciiStrLen to work on the string. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Nagaraj Hegde <nagaraj-p.hegde@hpe.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
2016-04-27NetworkPkg: Allow user to create a HTTP corporate boot option in setup page.Fu Siyuan
This patch updates the HTTP Boot Configuration page to allow the user to create a corporate mode HTTP boot option, by leaving the URI string empty. The patch also fix a bug that the L"https://" should use StrnCmp() with Length 8. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2016-04-22NetworkPkg: Fix GCC code build error of iSCSI driver.Zhang Lubo
Fix GCC build error when refine the codes of iSCSI driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2016-04-22NetworkPkg: refine codes of iSCSI driver.Zhang Lubo
Add error handling logic in DriverBingingStop function, it may return error status when invoking the UninstallProtocolInterface. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2016-04-14NetworkPkg: Fix issue in Ip6Dxe SetDataJiaxin Wu
EFI_NOT_READY should not be treated as an error status returned from SetData for Ip6ConfigDataTypeManualAddress since there is an asynchronous operation for DAD process. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Tested-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>