Commit Graph

352 Commits

Author SHA1 Message Date
Jiaxin Wu 30526a51dd NetworkPkg: HttpDxe response/cancel issue fix
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-13 11:51:47 +08:00
Jiaxin Wu 5ffe214ae9 NetworkPkg: Support TCP Cancel function
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-06-13 11:51:35 +08:00
Fu, Siyuan 5c944a654a NetworkPkg: Stop the timer before clean IP service.
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-31 10:56:21 +08:00
Jiaxin Wu 6be1193f14 NetworkPkg: Correct HttpConfigure parameter check
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-26 16:10:55 +08:00
Fu Siyuan 5646819ffb NetworkPkg: update code for NULL pointer check.
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-24 16:37:42 +08:00
Gary Lin 6340f2b858 NetworkPkg/HttpDxe: Don't free Wrap in HttpTcpReceiveNotifyDpc
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-20 12:40:19 +08:00
Gary Lin 72a4f34eab NetworkPkg/TcpDxe: Remove the status check of SockProcessRcvToken
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-20 12:39:52 +08:00
Nagaraj Hegde d8293d3141 NetworkPkg:HttpDxe: Code changes to support HTTP PUT/POST operations
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-16 14:22:33 +08:00
Gary Lin a93786ae6c NetworkPkg: Make HttpBootGetBootFile return EFI_BUFFER_TOO_SMALL
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-13 10:09:21 +08:00
Zhang, Lubo 89446d8967 NetworkPkg: Bug fix of iSCSI to support MPIO
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-12 09:35:30 +08:00
Fu Siyuan aa437778fc NetworkPkg: Ignore BootFileName if it is overloaded.
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-06 11:42:24 +08:00
Fu Siyuan b7f28e1a6c NetworkPkg: Ignore BootFileName if it is overloaded.
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-06 11:42:11 +08:00
Fu Siyuan a1522257a9 NetworkPkg: Fix a memory leak in HTTP boot driver.
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-06 10:47:45 +08:00
Sunny Wang 44a7d08b5a NetworkPkg/HttpBootDxe: Fix for the issue that the HTTP boot option can't be 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-06 09:00:57 +08:00
Fu Siyuan 6f2f4116eb NetworkPkg: Do not use hard coded TTL/ToS in PXE driver.
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-05 09:08:24 +08:00
Fu Siyuan 50a65824c7 NetworkPkg: Use UefiBootManagerLib API to create load option.
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-05-05 08:45:35 +08:00
Jiaxin Wu 59844e1266 NetworkPkg: Fix incorrect buffer free in HttpDxe
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-28 16:28:04 +08:00
Jiaxin Wu b347a22aec NetworkPkg: Avoid the indefinite wait case in HttpDxe
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-28 16:27:42 +08:00
Nagaraj Hegde 19c2572560 NetworkPkg:HttpDxe:Consume DxeHttpLib API changes
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-27 10:43:18 +08:00
Fu Siyuan 0aa0beca37 NetworkPkg: Allow user to create a HTTP corporate boot option in setup page.
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-27 10:19:12 +08:00
Zhang Lubo 6d0bab0e41 NetworkPkg: Fix GCC code build error of iSCSI driver.
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-22 16:58:06 +08:00
Zhang Lubo e590d29f6e NetworkPkg: refine codes of iSCSI driver.
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-22 15:41:46 +08:00
Jiaxin Wu 7959b06748 NetworkPkg: Fix issue in Ip6Dxe SetData
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>
2016-04-14 14:55:09 +08:00
Fu Siyuan 587d204ccd NetworkPkg: Add RAM disk boot support to HTTP Boot driver.
This patch updates the HTTP Boot driver to support the download and boot
a RAM disk image from HTTP server.
The HTTP RAM disk boot is described in section 23.7 "HTTP Boot" in
UEFI 2.6. HTTP server could provide either an UEFI image or a RAM disk image
for the HTTP boot client to use. The RAM disk image must contain a UEFI
compliant file system in it.
HTTP boot driver will identify the image type either by the "Content-Type"
entity header filed or by the file name extension as below:
  "application/efi" or *.efi -> EFI Image
  *.iso                      -> CD/DVD Image
  *.img                      -> Virtual Disk Image

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: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
2016-04-11 09:49:05 +08:00
Zhang Lubo c720da2866 NetworkPkg: Add new macros and refine codes
v2:
*refine some codes

Add 2 macros in NetLib.h
#define  IP4_MASK_MAX          32
#define  IP6_PREFIX_MAX        128
we will use these two macros to check the max mask/prefix length,
instead of
#define  IP4_MASK_NUM          33
#define  IP6_PREFIX_NUM        129
which means a valid number
This will make the code readability and maintainability.

Cc: Subramanian Sriram <sriram-s@hpe.com>
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: Sriram Subramanian <sriram-s@@hpe.com>
2016-04-11 08:24:47 +08:00
Fu Siyuan 37b680116d NetworkPkg: Check received packet size before use it.
Arbitrary length of packet may be received from network, including the
packets with zero payload data or malformed protocol header. So the code
much check the actually received data size before using it. For example, in
current edk2 network stack, an zero payload UDP packet may cause the
platform ASSERT in NetbufFromExt() because of the zero fragment number.
This patch update the IpIoLib and UdpIoLib to check and discard the zero
payload data packet to avoid above assert. Some other network drivers are
also updated to check the packet size to guarantee the minimum length of
protocol header is received from upper layer driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
2016-04-01 13:30:23 +08:00
Fu Siyuan d9ba76b489 NetworkPkg: Check pointer for NULL before use.
Cc: Ye Ting <ting.ye@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
2016-04-01 13:14:49 +08:00
Laszlo Ersek aa5fc205dd NetworkPkg: IpSecDxe: remove set but unused variables
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: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2016-03-25 10:52:31 +01:00
Zhang, Lubo 3decba3d32 NetworkPkg:Fix bug when parsing the dhcp6 option 16
when to parse the DHCP6 reply packet,there will be 6
bytes offset before the option data according to
RFC 3315.

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: Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
2016-03-25 11:33:02 +08:00
Zhang Lubo 651aeac672 NetworkPkg:Fix Http boot download issue.
When http boot download the second time without return
out of the boot manager, the DHCP process will start twice
with the same Boot file uri and print the information twice
which we not expected. This is caused by wrong logic
of handling the device path of the boot file when loading it.

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: Fu Siyuan <siyuan.fu@intel.com>
2016-03-25 11:32:57 +08:00
Fu Siyuan a5acc84226 NetworkPkg: Fix HII related problem in HTTP boot driver.
According to UEFI spec, HII_Config_Access.RouteConfig() should return success
if the required configuration has been processed. Current HTTP boot driver
may return error code in some situation, which failed the UEFI SCT test.
This patch fix this issue by removing the returned error status code and adding
extra check point in the Callback() function, which will pop up a message box
if user input an unsupported URI string.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Dong Eric <eric.dong@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
2016-03-24 10:09:47 +08:00
Fu Siyuan 7537258100 NetworkPkg: Fix the driver model issue in HTTP Boot driver.
The HTTP Boot driver have some UEFI driver model problems which will make the
code ASSERT when it's disconnected.
First, the driver opens the HttpSb protocol BY_CHILD without BY_DRIVER attribute.
So the driver binding stop won't be called when HTTP driver is disconnected, so
a child handle is left and made HTTP driver binding stop function goes into error.
This patch remove this unnecessary OpenProtocol and only unload the HII from when
both the IP4 and IP6 stack have been stopped completely.
The second issue is the HTTP boot driver always use the driver's image handle as
it's driver binding handle, it's not correct. HTTP Boot driver provides 2 separate
driver binding protocols from IP4 and IP6 stack, so it has 2 driver binding handle.
So this patch fix the code to use correct driver binding handle when create/open
a HTTP child handle.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2016-03-16 14:43:17 +08:00
Fu Siyuan 73617fa61a NetworkPkg: fix function comments in HttpBootDxe.
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: Zhang Lubo <lubo.zhang@intel.com>
2016-03-15 09:51:12 +08:00
Zhang, Lubo d1bc021ab3 NetworkPkg: Refine the code of shell app under networkPkg.
refine the code of ifconfig6 and ping6 application.

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>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2016-03-11 11:55:06 +08:00
Jiaxin Wu 96c1d78810 NetworkPkg: Fix IpsecConfig GCC build failure issue
This issue is caused by the string token ID for help message,
which is defined in the internal head file.
This head file is used for reference more than once. So,
multiple definition for the string token ID error will be
enrolled.

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: Liming Gao <liming.gao@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Zhang, Lubo <lubo.zhang@intel.com>
2016-03-11 08:33:57 +08:00
Ghazi Belaam f58554fc3f NetworkPkg: Use the New Functions from HttpLib
After submitting changes for HttpLib, other modules should be able to use
those functions
1 remove the private function and their calls
2 update it with the functions from httpLib

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ghazi Belaam <Ghazi.belaam@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Samer EL-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2016-03-10 10:01:42 +08:00
Fu Siyuan 44da8d28fd NetworkPkg: Convert UNI file to UTF8 format.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2016-03-10 09:48:20 +08:00
Laszlo Ersek 8244e19776 NetworkPkg: HttpBootDxe: fix gcc build failure.
Commit fa848a4048 ("NetworkPkg: Add URI configuration form to HTTP boot
driver") causes the build to fail with gcc:

> NetworkPkg/HttpBootDxe/HttpBootConfig.c: In function
>                                          'HttpBootAddBootOption':
> NetworkPkg/HttpBootDxe/HttpBootConfig.c:148:14:
> error: passing argument 3 of 'GetVariable2' from incompatible pointer
>        type [-Werror]
>               );
>               ^
> In file included from NetworkPkg/HttpBootDxe/HttpBootDxe.h:31:0,
>                  from NetworkPkg/HttpBootDxe/HttpBootConfig.c:15:
> MdePkg/Include/Library/UefiLib.h:708:1: note: expected 'void **' but
>                                         argument is of type 'CHAR16 **'
>  GetVariable2 (
>  ^
> cc1: all warnings being treated as errors

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-03-08 11:12:57 +08:00
Zhang, Lubo be6cd654eb NetworkPkg: Support print help information using -? command.
v2:
*Modify the logic of show SAD,SPD and PAD help info, include them in -?
instead of follow -p command.

Since Shell supports finding help information from resource section
of application image. We modify the Shell application Under NetworkPkg
to support print help information string using -? command.

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: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-03-07 09:57:09 +08:00
Fu Siyuan fa848a4048 NetworkPkg: Add URI configuration form to HTTP boot driver.
This patch updates the HTTP boot driver to produce a setup page for the boot
file URI configuration. A new boot option will be created for the manual
configured URI address. This change is made to support the HTTP boot usage
in home environment.

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-03-07 09:12:14 +08:00
Jiaxin Wu e19ce3a277 NetworkPkg: Revert git 'eb213f2f' fix
'eb213f2f' is associated with '3d0a49ad' commit. So, this patch is
used to respond the revert for '3d0a49ad' to adapt the Ipv4 config
policy update.

Cc: Subramanian Sriram <sriram-s@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>
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>
2016-03-02 15:43:55 +08:00
Jiaxin Wu 4720106b99 NetworkPkg: Change the default IPv6 config policy
The default policy for Ip6Config is Ip6ConfigPolicyAutomatic,
which results in all NIC ports starting SARR process when it
receives RA message with M flag from IPv6 router. So, this
patch is used to changes the the default IPv6 config policy to
Ip6ConfigPolicyManualand also defer the SetData operation after
Ip6ConfigProtocol installed. This update let the other platform
drivers have chance to change the default config data by consume
Ip6ConfigProtocol.

Cc: Subramanian Sriram <sriram-s@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>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Subramanian Sriram <sriram-s@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
2016-03-02 15:43:52 +08:00
Samer El-Haj-Mahmoud 90f658c460 NetworkPkg: Use Http11 definitions in HttpDxe and HttpBootDxe
Change HttpDxe and HttpBootDxe to use the standard definitions from
Http11.h instead of private duplicate definitions.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-02-25 15:02:31 +08:00
Jiaxin Wu 3700da7384 NetworkPkg: Replace the internal function with exposed one
This patch is used to replace the internal function with
the exposed one defined in NetLib.h.

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>
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-02-18 13:07:59 +08:00
Samer El-Haj-Mahmoud 40696972bf NetworkPkg: better sanity check on Ipv6 prefix length
Fix a possible buffer overrun issue that could occur if PrefixLength >
128 . Changed == 128 to >= 128. Also remove check for Byte < 16, which
is no longer possible because of the first change.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-02-14 10:31:20 +08:00
Samer El-Haj-Mahmoud 93aea44f42 NetworkPkg: Reword PXE download message
Fix a minor grammatical error in the PXE boot message.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-02-14 10:18:54 +08:00
Zhang Lubo 072289f45c NetworkPkg:Add a new error status code EFI_HTTP_ERROR
v4:
* Update macro HTTP_ERROR_STATUS to HTTP_ERROR_OR_NOT_SUPPORT_STATUS_CODE
Update copyright year.
When the Error Status of ResponseData returned from HttpIoRecvResponse
function during the Http HEAD method, it should also return error status
to Load file protocol.

Add a new error status code EFI_HTTP_ERROR in corresponding with the
UEFI 2.6 spec . When a HTTP error occurred during the network operation,
The EFI_HTTP_ERROR is returned in token.

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: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2016-02-03 11:48:36 +08:00
Zhang Lubo bec55c33c7 NetworkPkg: Fix suspicious dereference of pointer 'Mode.Ia'
This patch is used to fix suspicious dereference of pointer 'Mode.Ia'
before NULL check.

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: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2016-02-03 11:43:19 +08:00
Jiaxin Wu 0f4e123f2f NetworkPkg: Correct inconsistent function descriptions in DNS
This patch is used to correct inconsistent function descriptions
in DnsDxe.

Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19781 6f19259b-4bc3-4df7-8a09-765794883524
2016-02-01 01:43:12 +00:00
Zhang Lubo f0ab5a81b4 NetworkPkg: Change HTTP API typos.
Change HTTP API typos and clarify returned status code in HTTP API.


Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19761 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-28 03:15:35 +00:00
Zhang Lubo ce22514e48 NetworkPkg:Fix Network memory leak when calling GetModeData interface
Multiple network protocols have a GetModeData() interface, which may
allocate memory resource in the return mode data structure. It's
callers responsibility to free these buffers.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19758 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-28 02:32:43 +00:00
Hao Wu 4df590991b NetworkPkg: Add NOOPT target in NetworkPkg.dsc
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>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19675 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-19 04:06:24 +00:00
Jiaxin Wu a51896e475 NetworkPkg: Fix SPD entry edit policy issue in IPSecConfig.
The current implementation doesn't handle the relationship
between SPD and SAD well, which may introduce some security
and connection issue after SPD updated.
For SPD entry edit policy, if one SPD entry is edited/updated,
the original SAs list should be discard. Current IPSecConfig
tool does not dealt properly with those rules.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@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>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19653 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-18 01:59:41 +00:00
Jiaxin Wu 4991eeffcd NetworkPkg: Fix IpSec SPD and SAD mapping issue when SPD is updated
The current implementation doesn't handle the relationship between
SPD and SAD well, which may introduce some security and connection
issue after SPD updated.
For SPD SetData policy:
 A) When delete the existed SPD entry, its related SAs also should be
removed from its Sas list(SadEntry->BySpd). If the SA entry is
established by IKE, we can remove it from global SAD list(SadEntry->List)
and then free it directly since its SpdEntry will be freed later.
 B) SPD SetData operation should do some setting date validity-check.
For example, whether the SaId specified by setting Data is valid. If
the setting date is invalid, EFI_INVALID_PARAMETER should be returned.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@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>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19652 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-18 01:59:16 +00:00
Jiaxin Wu a74f05d972 NetworkPkg: Remove DNS QType and QClass definition
This patch is used to remove DNS QType and QClass definition in
DnsImpl.h since it will be exposed in NetLib.h.

Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@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: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19643 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-14 03:00:38 +00:00
Paulo Alcantara ef422fc53c NetworkPkg: Fix some typos in Http boot driver.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Paulo Alcantara <paulo.alc.cavalcanti@hp.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19640 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-12 01:37:48 +00:00
Laszlo Ersek c9c28f38b1 NetworkPkg: DnsDxe: fix return type of DnsFillinQNameForQueryIp()
Change the return type of DnsFillinQNameForQueryIp() from (UINT8*) to
(CHAR*). This brings the function in sync with both its internal variables
and all of its call sites, fixing the following gcc build breakage:

> NetworkPkg/DnsDxe/DnsImpl.c: In function 'DnsFillinQNameForQueryIp':
> NetworkPkg/DnsDxe/DnsImpl.c:1068:3: error: pointer targets in return
>                                     differ in signedness
>                                     [-Werror=pointer-sign]
>    return QueryName;
>    ^

The code was added in git commit fcae1a99 (SVN r19579).

Cc: Subramanian Sriram <sriram-s@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: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19609 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-06 12:34:46 +00:00
Hao Wu 59c0c1cb55 NetworkPkg IScsiDxe: Fix typos in function descriptions
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19601 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-06 01:12:27 +00:00
Hao Wu 682c9b4afe NetworkPkg IpSecDxe: Fix a typo in function description
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19600 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-06 01:12:07 +00:00
Jiaxin Wu 8339166dd1 NetworkPkg: Removing or adding some ASSERT statement
Refine the code by removing or adding some ASSERT statement
to make the code more readable.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@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>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19592 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-06 00:55:38 +00:00
Jiaxin Wu fcae1a9936 NetworkPkg: Support DNS4/6 GeneralLookUp feature
This patch is used to support DNS4/6 GeneralLookUp feature.

Cc: Subramanian Sriram <sriram-s@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>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19579 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-30 08:10:55 +00:00
Jiaxin Wu 5346adbb18 NetworkPkg: Fix suspicious dereference of pointer before NULL check
This patch is used to fix suspicious dereference of pointer before
NULL check in IScsiDxe driver.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@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>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19552 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-25 08:10:37 +00:00
Liming Gao 75f468077c NetworkPkg: Update module inf to include the missing uni file
Update DnsDxe and HttpUtilitiesDxe inf files.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19511 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-24 02:31:06 +00:00
Ye Ting 152a991319 NetworkPkg: Update NetworkPkg.uni to UTF-8 file format
Patch "NetworkPkg: Update iSCSI driver to check existing AIP instances"
updates NetworkPkg.uni to UTF-16LE wrongly. The patch uses
BaseTools\Scripts\ConvertUni.py to change it back to UTF-8 file format.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Gao Liming <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19483 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-23 07:55:27 +00:00
Fu Siyuan 7552c24e76 NetworkPkg: Remove a CopyMem to speed up the HTTP boot download.
This patch updates the HTTP boot driver to use the caller provided buffer
directly in identity transfer-coding mode, this could save one time CopyMem
operation to benefit the download performance.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19482 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-23 06:54:52 +00:00
Jiaxin Wu 5b9a923529 NetworkPkg: Remove unused EFI_HTTP_PROTOCOL definition
This patch is used to remove unused EFI_HTTP_PROTOCOL definition.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@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: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19463 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-23 00:34:14 +00:00
Samer El-Haj-Mahmoud 81c16b17ad NetworkPkg : Remove unused local variables to fix gcc build errors.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19436 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-22 02:02:11 +00:00
Zhang Lubo 5ba9f065a5 NetworkPkg:Fix a bug the 2nd httpboot fail issue.
Httpboot over Ipv4 or Ipv6 stack,for both Identity and chunked transfer
mode,when the last data has been parsed by HttpLib, the
HttpInstance->NextMsg pointer should point a correct location.Now after
the first successful httpboot for ipv4 or ipv6,the 
HttpInstance->NextMsgpoint the character after the last byte, it may 
be a bad buffer if we don't receive another HttpHeader, so if call a 
2nd httpboot, the wrong NextMsg pointer will cause the httpboot fail, 
so we need to check this case in HttpBodyParserCallback function in 
the first http boot process.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19423 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-21 01:36:08 +00:00
Ye Ting 8873b174c7 NetworkPkg: Update iSCSI driver to check existing AIP instances
According to UEFI spec, iSCSI HBA must install an AIP instance
with network boot information block. This patch updates UEFI
iSCSI driver to check whether there are AIP instances installed
by iSCSI HBA adapter and if yes, the UEFI iSCSI driver will return
EFI_ABORTED in its driver binding Start(). Also the patch
introduces a PCD PcdIScsiAIPNetworkBootPolicy for
platform owner to define particular policy when the iSCSI HBA
will survive and UEFI iSCSI will fail. The default policy is
STOP_UEFI_ISCSI_IF_AIP_SUPPORT_OFFLOAD which means that when ISCSI HBA
adapter installs an AIP and claims it supports an offload engine
for iSCSI boot, the UEFI iSCSI driver will return EFI_ABORTED.

The patch V2 adds a new value ALWAYS_USE_UEFI_ISCSI_AND_IGNORE_AIP
to PCD PcdIScsiAIPNetworkBootPolicy. This allows the platform to
avoid running into buggy IHV drivers that have issue with AIP.
It is suggested by El-Haj-Mahmoud,Samer <samer.el-haj-mahmoud@hpe.com>.

Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19367 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-18 06:31:31 +00:00
Zhang Lubo 621a618a8c NetworkPkg:Fix the issue Http boot hang when network failed.
For both IPv4 and IPv6, when network transfer failed, such as disconnected
cable or disable http server, HTTP boot should exit back to the menu UI
rather than hang.

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: Wu Jiaxin <jiaxin.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19335 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-18 01:52:17 +00:00
Liming Gao 424328c892 NetworkPkg: Correct gEfiUdp4ProtocolGuid usage in DnsDxe
DnsDxe driver locates gEfiUdp4ProtocolGuid. Its usage should be TO_START.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19317 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-17 08:30:27 +00:00
Jordan Justen b55fecfee6 NetworkPkg: Convert all .uni files to utf-8
To convert these files I ran:

$ python3 BaseTools/Scripts/ConvertUni.py NetworkPkg

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19258 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-15 04:56:57 +00:00
Jiaxin Wu 00c0c3f24f NetworkPkg: Fix the potential NULL pointer dereferenced issue
This patch is used to fix the potential NULL pointer dereferenced
in function 'ParseDnsResponse'.

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: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19178 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-10 01:44:56 +00:00
Zhang Lubo 81438fe8d0 NetworkPkg: Fix a bug in HttpBootDriverBindingStop() when destroying child.
If Http Driver is being unloaded or DisconnectController() without
invoke HttpBootStart(), this will cause an unexpected ASSERT.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19005 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-30 01:41:50 +00:00
Zhang Lubo 1b96428d92 NetworkPkg:Fix NULL pointer dereference issues.
Revise some errors that some Null pointers may be dereferenced.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18961 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-26 08:17:46 +00:00
Zhang Lubo a2e619821a NetworkPkg: Httpboot will fail the 2nd time result by wrong TCP state.
If the 2nd boot quickly after the first succeed boot, it will function well.
But if you wait for some time after 1nd succeed boot and boot again, the 
TCP state may change from established to closed wait as the http server send 
fin flag, then boot fail occurred.

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>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18783 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-13 09:35:54 +00:00
Zhang Lubo 62cae3513b NetworkPkg: Report Http Errors to screen when http layer occurs an error
Http server will return error status in http header when http connection
cannot be established,so the http boot driver should print the error code
code to the screen and the users can know what happened.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Ye Ting <ting.ye@intel.com> 
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18761 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-10 02:18:31 +00:00
Zhang Lubo ac4588532d NetworkPkg:Fix the issue that cannot parse ipv6 address correctly.
If there is a ipv6 expressed url, the NetLibAsciiStrToIp6 cannot get the Ipv6
address from the host name, because the host name contains left and right
bracket which cannot be used to configure the Tcp6 connection.

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>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18745 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-09 07:00:20 +00:00
Zhang Lubo b659408b93 NetworkPkg:Enable Http Boot over Ipv6 stack
Add new features to support Http boot over ipv6 stack.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18743 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-09 03:30:42 +00:00
Nagaraj Hegde 3666990b0f NetworkPkg:Missing CloseEvent() in HttpResponseWorker
Two additional scenarios in which CloseEvent() needs to be called:
When sending a request to http server using HTTP Head method, if the process
is success, we did a response call, and then go to exit without close the
event in Rxtoken in wrap structure and in httpinstance struceure, so
another call() to response using http get method to receive http header,
those events are not closed either..

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: Zhang Lubo <lubo.zhang@intel.com>




git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18735 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-06 09:35:09 +00:00
Nagaraj Hegde cdf8c32ec1 NetworkPkg: HttpDxe sometimes free a pointer twice
In EfiHttpRequest, HostName was getting freed twice whenever
HttpTransmitTcp4 failed. Moved FreePool (HostName) after
HttpTransmitTcp4 call to avoid a double free.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Nagaraj Hegde <nagaraj-p.hegde@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18709 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-30 06:47:54 +00:00
Fu Siyuan c476450456 NetworkPkg: reset DHCP child when leaving PXE LoadFile.
The DHCP4 can have only one configured child instance so we need to reset
the DHCP4 child when leaving PXE driver's LoadFile() function, otherwise the
other programs which also need to use DHCP4 (like HTTP boot) will be impacted.

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: Sriram Subramanian <sriram-s@hpe.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18616 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-16 07:18:51 +00:00
Fu Siyuan bf9f7cea98 NetworkPkg: remove unnecessary timeout event when setting IPv6 address.
Use Ip6Cfg->SetData() to set IP6 manual address is asynchronous process and the
registered data notify event will be singled when process is done. So it's not
necessary to create another timeout event for the address setting.

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: Jiaxin Wu <jiaxin.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18610 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-15 06:42:50 +00:00
Samer El-Haj-Mahmoud c5a693cea6 NetworkPkg: HttpDxe: Remove unused local variables
Fix gcc build errors [-Werror=unused-but-set-variable].

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Build-tested-by: Laszlo Ersek <lersek@redhat.com>
[lersek@redhat.com: add more details to commit message]
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18573 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-06 19:49:13 +00:00
Ye Ting 87ce4210f5 NetworkPkg:Fix iSCSI driver issue to work with iSCSI LIO target
The patch fixes iSCSI driver can't reinstate itself when configured
 in AutoConfigure mode and IPv6 stack is actually used.
The issue occurs when iSCSI driver communicates with
iSCSI LIO target in IPv6 path and the target sends
back TCP FIN packets randomly.

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu jiaxin <jiaxin.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18546 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-25 03:51:46 +00:00
Samer El-Haj-Mahmoud 8cfd008ef8 NetworkPkg: Fix typos in some EFI_HTTP_STATUS_CODE definitions
Fix spelling typos in EFI_HTTP_STATUS_CODE definitions for error 415 and 501.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18521 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-21 07:53:16 +00:00
Jiaxin Wu 2f667c5488 NetworkPkg: Fix connection issue after correct SPD and re-enable IPsec
This patch is used to fix connection failure issue after correct the SPD
and re-enable IPsec. The driver should not update the SadEntry's SpdSelector
when doing SpdEntry modification. SadEntry's SpdSelector may not equal to
this edited SpdEntry’s Selector.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@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>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18484 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-16 09:02:48 +00:00
Fu Siyuan 96702f88a3 NetworkPkg: TrafficDirection not saved in IPsecConfig.
Fix a bug that the TrafficDirection field is not saved in IPsecConfig.SetData.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18483 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-16 08:52:43 +00:00
Fu Siyuan a8706acb0e NetworkPkg: Enhance the NULL pointer check before dereference it.
This patch enhances the NULL pointer check of the HttpInstance->RemoteHost
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>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18482 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-16 08:52:24 +00:00
Fu Siyuan 7ef0690f7c NetworkPkg: Correct the missed code in r18449.
The fix r18449 missed 1 line which will cause Http.Request() ASSERT. This patch
will correct this error.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18453 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-15 00:59:37 +00:00
Fu Siyuan 49c9f74cc1 NetworkPkg: Update Http driver to use DPC mechanism.
This patch updates the HttpDxe driver to use the DPC mechanism to avoid long
time delay when single event.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18451 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-14 09:06:26 +00:00
Fu Siyuan ccb71333c2 NetworkPkg: RxToken event not closed in Http.Response().
This patch contains a bug fix in HTTP driver that the RxToken is not closed,
this is one of the main reasons which lower the HTTP download speed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18450 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-14 09:06:02 +00:00
Fu Siyuan 51b0450e00 NetworkPkg: Avoid memory allocation for each HTTP message exchange.
This patch updates the HTTP driver to use a shared buffer for URL parsing to
avoid memory allocation for each HTTP request.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18449 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-14 09:05:49 +00:00
Fu Siyuan 7fd71047a6 NetworkPkg: Update cache management in HTTP boot driver.
The original HTTP boot driver always save the received message body in its cache,
it bring a large of memory allocation during HTTP download. This patch updates
the HTTP boot driver to only cache data when caller doesn't provide a buffer for
download (which is usually used when caller want to get the required buffer size).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18448 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-14 09:05:12 +00:00
Fu Siyuan b578030972 NetworkPkg: Enlarge receive block size of HTTP boot driver.
HTTP boot driver uses block size of 1024 when receiving HTTP message body,
but typically the MTU of Ethernet is 1500 bytes so it makes 1 TCP segment data
split into 2 Http.Response call. This patch enlarges the block size to avoid
this issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18447 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-14 09:04:25 +00:00
Zhang Lubo 94d449f5df NetworkPkg: PXE Driver's LoadFile protocol should check FilePath
PXE driver's LoadFile protocol should check the input parameter
FilePath to see whether it's a supported device path.If not,
it should return invalid parameter, do not continue PXE boot.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18436 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-10 09:51:00 +00:00
Jiaxin Wu 2ba88dc554 NetworkPkg: Fix suspicious dereference of pointer 'FieldCount'
This patch is used to fix suspicious dereference of pointer 'FieldCount'
before NULL check.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@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>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18409 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-08 02:01:05 +00:00
Zhang Lubo 374ecd0450 NetworkPkg: Fix the HttpCloseConnection fail issue
When HTTP server is unavailable,HttpCloseConnection will enter
infinite loop to wait for TCP4->close Event return, So we need to
decide the Http Instance state whether in the appropriate state
before close it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18400 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-06 01:30:44 +00:00
Fu Siyuan 01097ae1c2 NetworkPkg: remove redundant words in function comment.
A function with void return type doesn't need @retval line in its function
comment. This patch removes one redundant line from Ip6 driver in r18365.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18384 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-02 07:40:21 +00:00
Samer El-Haj-Mahmoud c79de074b6 MdeModulePkg/NetworkPkg: Locate IpSec on IP packet processing only if it's installed.
Modified the logic in Ip4Dxe and Ip6Dxe to not locate EFI_IPSEC2_PROTOCOL on each
message transmit/receive. Instead, register a callback in the drivers entry points
on the IpSec protocol installation, and process only if the protocol is installed.
This speeds up the network stacks when IpSec is not installed since there is a
penalty associated with searching the entire handle database on each packet processing.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hp.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18365 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-31 07:44:12 +00:00