summaryrefslogtreecommitdiffstats
path: root/NetworkPkg
Commit message (Collapse)AuthorAgeFilesLines
* NetworkPkg: Removing ipf which is no longer supported from edk2.chenc22018-08-1410-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removing rules for Ipf sources file: * Remove the source file which path with "ipf" and also listed in [Sources.IPF] section of INF file. * Remove the source file which listed in [Components.IPF] section of DSC file and not listed in any other [Components] section. * Remove the embedded Ipf code for MDE_CPU_IPF. Removing rules for Inf file: * Remove IPF from VALID_ARCHITECTURES comments. * Remove DXE_SAL_DRIVER from LIBRARY_CLASS in [Defines] section. * Remove the INF which only listed in [Components.IPF] section in DSC. * Remove statements from [BuildOptions] that provide IPF specific flags. * Remove any IPF sepcific sections. Removing rules for Dec file: * Remove [Includes.IPF] section from Dec. Removing rules for Dsc file: * Remove IPF from SUPPORTED_ARCHITECTURES in [Defines] section of DSC. * Remove any IPF specific sections. * Remove statements from [BuildOptions] that provide IPF specific flags. Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chen A Chen <chen.a.chen@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg/HttpDxe: Strip square brackets in IPv6 expressed HostName.Jiaxin Wu2018-08-031-3/+15
| | | | | | | | | | | | | | | | | | | *v2: Optimize the patch by calculating AsciiStrSize() only once. In URI, the colon (:) is used to terminate the HostName path before a port number. However, if HostName is expressed as IPv6 format, colon characters in IPv6 addresses will conflict with the colon before port number. To alleviate this conflict in URI, the IPv6 expressed HostName are enclosed in square brackets ([]). To record the real IPv6 HostName, square brackets should be stripped. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* NetworkPkg/HttpDxe: Fix the bug when parsing HTTP(S) message body.Jiaxin Wu2018-07-123-54/+78
| | | | | | | | | | | | | | | | | | | | | | *v2: Resolve the conflict commit. *v3: Fixed the failure if BodyLength in HTTP token is less than the received size of HTTPS message. HttpBodyParserCallback function is to parse the HTTP(S) message body so as to confirm whether there is the next message header. But it doesn't record the parsing message data/length correctly. This patch is refine the parsing logic so as to fix the potential failure. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Gary Lin <glin@suse.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Tested-by: Gary Lin <glin@suse.com>
* NetworkPkg: Clean up source filesLiming Gao2018-06-28180-3640/+3640
| | | | | | | | | 1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/NetworkPkg: Checking for NULL pointer before use.Fu Siyuan2018-06-212-1/+4
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sivaraman Nainar <sivaramann@amiindia.co.in> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg/NetworkPkg.dsc: Add the instance of library class [SafeIntLib].Jiaxin Wu2018-05-071-0/+1
| | | | | | | | | | | | | | This patch is to add the instance of library class [SafeIntLib] to fix the NetworkPkg build error, which is caused by the commit of 2167c7f7 that the TlsLib will always consume SafeIntLib. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Long Qin <qin.long@intel.com> Cc: Bi Dandan <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Long Qin <qin.long@intel.com>
* NetworkPkg/TlsDxe: clean up byte order conversion for EfiTlsCipherListLaszlo Ersek2018-04-131-1/+4
| | | | | | | | | | | | | | | | | | | | | | | Fix the following style issues: - "Data" is accessed through a pointer to UINT16 rather than to a pointer to EFI_TLS_CIPHER. While technically correct, UINT16 is harder to interpret against the UEFI spec. - Array subscripting is written with weird *(Pointer + Offset) expressions, rather than with Pointer[Offset]. - The byte order is converted with HTONS(), while it should be NTOHS(). Either way, use the Data1 and Data2 fields of EFI_TLS_CIPHER instead. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=915 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Long Qin <qin.long@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg/TlsDxe: verify DataSize for EfiTlsCipherListLaszlo Ersek2018-04-131-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | TlsSetSessionData() shouldn't just ignore an incomplete EFI_TLS_CIPHER element at the end of "Data": - Generally speaking, malformed input for a security API is best rejected explicitly. - Specifically speaking, the size of EFI_TLS_CIPHER is 2 bytes. If DataSize is 1 on input, then the initial check for (DataSize == 0) will fail, but then TlsSetCipherList() will be called with CipherNum=0. Return EFI_INVALID_PARAMETER from TlsSetSessionData() if "Data" doesn't contain a whole number of EFI_TLS_CIPHER elements. While at it, introduce the dedicated variable CipherCount. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=915 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Long Qin <qin.long@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg/TlsAuthConfigDxe: preserve TlsCaCertificate variable attributesLaszlo Ersek2018-03-281-7/+8
| | | | | | | | | | | | | | | | | | If the platform creates the "TlsCaCertificate" variable as volatile, then EnrollX509toVariable() shouldn't fail to extend it just because TLS_AUTH_CONFIG_VAR_BASE_ATTR contains the EFI_VARIABLE_NON_VOLATILE attribute. Thus, if the variable exists, add the EFI_VARIABLE_APPEND_WRITE attribute to the variable's current attributes. This is what DeleteCert() does already. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg/HttpDxe: sanity-check the TlsCaCertificate variable before useLaszlo Ersek2018-03-282-1/+67
| | | | | | | | | | | | | | | | | | In TlsConfigCertificate(), make sure that the set of EFI_SIGNATURE_LIST objects that the platform stored to "TlsCaCertificate" is well-formed. In addition, because HttpInstance->TlsConfiguration->SetData() expects X509 certificates only, ensure that the EFI_SIGNATURE_LIST objects only report X509 certificates, as described under EFI_CERT_X509_GUID in the UEFI-2.7 spec. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=909 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg/HttpDxe: drop misleading comment / status code in cert configLaszlo Ersek2018-03-281-2/+0
| | | | | | | | | | | | | | | | | | | | For TlsConfigureSession(), it makes sense to exempt EFI_NOT_FOUND from TlsConfigCipherList() / gRT->GetVariable(), because there is a default cipher list (SSL_DEFAULT_CIPHER_LIST) we can fall back to. The same is not true of TlsConfigCertificate(), because there is no default CA cert list. The platform (or the user of the Setup utility) is required to configure a CA cert list first. Remove the misleading comment and status code mapping in TlsConfigCertificate(). Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg/HttpDxe: use error handler epilogue in TlsConfigCertificate()Laszlo Ersek2018-03-281-5/+4
| | | | | | | | | | | | | Introduce a FreeCACert label near the end of the function, so that we can keep the FreePool(CACert) statement centralized for error and success exits. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg/HttpBootDxe: fix typo in DHCPv4 packet parsingLaszlo Ersek2018-03-281-2/+2
| | | | | | | | | | | | | | The string "HTTPClient" has 10 non-NUL characters; the value 9 is a copy-paste leftover from "PXEClient". Check for all 10 characters in the vendor-class-identifier option when determining whether the DHCP offer is an HTTP offer. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg: Correct HttpTlsCipherList.h file format to DOSLiming Gao2018-03-261-38/+38
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg/UefiPxeBcDxe: Configure the ARP Instance/RouteTable with new addressJiaxin Wu2018-03-222-40/+52
| | | | | | | | | | | After completed a DHCP D.O.R.A process and got the new address, the ARP Instance and RouteTable should be configured so as to avoid the later Pxe.Arp failure. 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: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg/HttpDxe: Handle the large data request via HTTPS channel.Jiaxin Wu2018-03-223-39/+111
| | | | | | | | | | Cc: Karunakar P <karunakarp@amiindia.co.in> 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: Karunakar p <karunakarp@amiindia.co.in> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg/TlsDxe: Handle the multiple TLS record messages ↵Jiaxin Wu2018-03-222-28/+52
| | | | | | | | | | | | encryption/decryption. Cc: Karunakar P <karunakarp@amiindia.co.in> 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: Karunakar p <karunakarp@amiindia.co.in> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg/IScsiDxe: Fix the ISCSI connection failure in certain case.Jiaxin Wu2018-03-131-1/+1
| | | | | | | | | | | | | | | The ISCSI connection will fail for the first time if the target info is retrieved from DHCP and expressed as URI format. The issue is caused by the missing DNS protocol dependency check during the driver support function. This patch is to fix the above issue. 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: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg/HttpDxe: Support HTTP Delete Method.Jiaxin Wu2018-03-021-4/+5
| | | | | | | | | | | | | Per the request to support HttpMethodDelete: https://bugzilla.tianocore.org/show_bug.cgi?id=879, This patch is to enable the HTTP Delete Method. Cc: Karunakar P <karunakarp@amiindia.co.in> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg/Udp6Dxe: Fix the failure to leave one multicast group address.Jiaxin Wu2018-03-021-0/+3
| | | | | | | | | | | | | | The issue was enrolled by the commit of ceec3638. One of the change in the commit was to return the status from NetMapIterate in Udp6Groups function. But it should not return EFI_ABORTED directly in case McastIp is not NULL, which means to terminate the iteration and leave the McastIp successfully. Cc: Wang Fan <fan.wang@intel.com> 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: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg/HttpBootDxe: Fix the incorrect error message output.Jiaxin Wu2018-03-022-17/+21
| | | | | | | | | | | | | | | | | | | | | | | For IPv6 case, if one invalid URL returned from DHCP server, HttpBootDxe driver could not retrieve the URL host address from DNS server. In such a case, the error message should be printed as: Error: Could not retrieve the host address from DNS server. Instead of: Error: Could not discover the boot information for DHCP server. Then, we can still output as following: Error: Could not retrieve NBP file size from HTTP server. Besides, currently implementation in HttpBootLoadFile will always output error message even the HTTP process is correct. This patch is to fix above issue. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* NetworkPkg/HttpBootDxe: Correct the parameter check for the usage of ↵Jiaxin Wu2018-03-021-7/+6
| | | | | | | | | | | | | HttpBootGetFileFromCache. The patch is to fix the incorrect parameter check for the HttpBootGetFileFromCache(). Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* NetworkPkg: Read HttpTlsCipherList variable and configure it for HTTPS session.Jiaxin Wu2018-02-143-3/+95
| | | | | | | | | | | | | | | | | | | | | | | | v2: * Refine the error handling returned from GetVariable. This patch is to read the HttpTlsCipherList variable and configure it for the later HTTPS session. If the variable is not set by any platform, EFI_NOT_FOUND will be returned from GetVariable service. In such a case, the default CipherList created in TlsDxe driver will be used. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Kinney Michael D <michael.d.kinney@intel.com> Cc: Zimmer Vincent <vincent.zimmer@intel.com> Cc: Yao Jiewen <jiewen.yao@intel.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: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* NetworkPkg: Define one private variable for HTTPS to set Tls CipherList.Jiaxin Wu2018-02-142-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | v2: * Rename the file/variable name. This variable (HttpTlsCipherList) can be set by any platform that want to control its own preferred Tls CipherList for the later HTTPS session. The valid contents of variable must follow the TLS CipherList format defined in RFC 5246. The valid length of variable must be an integral multiple of 2. For example, if below cipher suites are preferred: CipherSuite TLS_RSA_WITH_AES_128_CBC_SHA256 = {0x00,0x3C} CipherSuite TLS_RSA_WITH_AES_256_CBC_SHA256 = {0x00,0x3D} Then, the contents of variable should be: {0x00,0x3C,0x00,0x3D} Cc: Laszlo Ersek <lersek@redhat.com> Cc: Kinney Michael D <michael.d.kinney@intel.com> Cc: Zimmer Vincent <vincent.zimmer@intel.com> Cc: Yao Jiewen <jiewen.yao@intel.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: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* NetworkPkg: Add warning message for PXE if failed to read system GUID from ↵Fu Siyuan2018-02-052-0/+4
| | | | | | | | | | | | SMBIOS. Current PXE driver uses zero GUID if failed to get the system GUID from smbios table, and some OS PXE boot may fail in such case. This patch is to add a warning message to inform user that smbios table is missed on the platform. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
* NetworkPkg/HttpBootDxe: Avoid to corrupt HttpBootDxe setup screen.Jiaxin Wu2018-01-252-2/+10
| | | | | | | | | | | | | | When giving an invalid URI in Boot URI field within HTTP Boot configuration page, the AsciiPrint will corrupt the setup screen. This patch is to resolve the issue. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Karunakar P <karunakarp@amiindia.co.in> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg: Update package version to 0.98Fu Siyuan2018-01-232-4/+4
| | | | | | | Update package version of NetworkPkg to 0.98. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg: Fix incorrect parameter check in PXE.Mtftp() function.Fu Siyuan2018-01-151-1/+9
| | | | | | | | | | According to UEFI spec, the PXE.Mtftp() should return invalid parameter if the BufferPtr parameter was NULL and the DontUseBuffer parameter was FALSE. The DontUseBuffer is only used when perform MTFTP/TFTP read operation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg: Add more parameter or return status check in UDP6 driverWang Fan2018-01-113-22/+45
| | | | | | | | | | | | | In UDP6Dxe, there are several places that may be enhanced to check input parameters and returned status. This patch is to fix these issues. Cc: Ye Ting <ting.ye@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan <fan.wang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg: Fix some coding style issues in UDP6 driverWang Fan2018-01-113-15/+17
| | | | | | | | | | | | In UDP6Dxe, there are some coding style issues, this patch is to fix these issues. Cc: Ye Ting <ting.ye@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan <fan.wang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg: Fix a memory leak issue in UDP6 driverWang Fan2018-01-111-0/+3
| | | | | | | | | | | | | In UDP6Dxe Udp6Groups(), the code return directly without free the buffer allocated for McastIp when JoinFlag is TRUE. It is a memory leak issue that needs to be fixed. This patch is to fix this issue. Cc: Ye Ting <ting.ye@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan <fan.wang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg: Add ASSERT error handling for UDP6 driverWang Fan2018-01-112-2/+21
| | | | | | | | | | | | | In Udp6Dxe, there are several places use ASSERT to check returned value. But these errors should be handled if they occur, this patch is to fix this issue. Cc: Ye Ting <ting.ye@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan <fan.wang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg/IScsiDxe: Set ExitBootServiceEvent to NULL after close it.Jiaxin Wu2018-01-101-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | v2: * Refine the commit log. There are two place to close the ISCSI ExitBootServiceEvent: #1.IScsiOnExitBootService(), which is the callback function of ExitBootServiceEvent. #2.IScsiCleanDriverData(), which will be invoked by ISCSI driver binding stop(). So, the ExitBootServiceEvent will be closed and freed when exit boot server is triggered. But it may be closed and freed again in ISCSI driver binding stop(), which will result in the issue recorded at https://bugzilla.tianocore.org/show_bug.cgi?id=742. This patch is to resolve the issue. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg/HttpDxe: Fix build warning error if CHAR8 is unsigned.Jiaxin Wu2018-01-101-2/+2
| | | | | | | | | | | | | | | | | | | | This patch is to fix the compiler warning error: C4245. The issue will happen if the below build option is enabled: *_*_*_CC_FLAGS = -J. That's because the value of ('A' - 'a') is a negative value, which will be converted to an unsigned type if CHAR8 is treated as unsigned: Src -= ('A' - 'a'); The above issue is also recorded at: https://bugzilla.tianocore.org/show_bug.cgi?id=815. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg: Update PXE driver to check for NULL pointer before use it.Fu Siyuan2018-01-041-12/+8
| | | | | | | | | | This patch is to fix the issue that dereferencing of "This" (EFI_LOAD_FILE_PROTOCOL) in EfiPxeLoadFile() is happening before the NULL check. 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: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg: Add assert for buffer pointer from DHCP driver.Fu Siyuan2018-01-041-0/+4
| | | | | | | | | | | The PxeBcDhcp4CallBack() is provided for DHCP driver to invoke packet check during DHCP process, the DHCP driver should make sure Packet and NewPacket has meaningful value. This patch adds assert for this. 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: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg: Fix memory leak problem in PXE driver.Fu Siyuan2018-01-042-7/+25
| | | | | | | 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: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg: Check allocated buffer pointer before use.Fu Siyuan2018-01-041-1/+4
| | | | | | | 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: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg: Abort the PXE process if DHCP has been started by other instance.Fu Siyuan2018-01-041-7/+2
| | | | | | | | | | | PXE need to use extended DHCP options and check received offers in callback function, so there is no need to continue the PXE process if DHCP driver has been started by other instance but not PXE driver itself. 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: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg: Convert source file to DOS formatLiming Gao2017-12-281-1/+1
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
* NetworkPkg/IScsiDxe: Correct the DnsMode value according the target info.Jiaxin Wu2017-12-271-0/+1
| | | | | | | | | | | | | | | | | | When the platform gets the target info from DHCP (option 17) and the ISCSI server is expressed as IP address, the value of DnsMode should be false, otherwise, the failure will happen in certain case. please refer to https://bugzilla.tianocore.org/show_bug.chi?id=823 for the detailed steps. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Karunakar P <karunakarp@amiindia.co.in> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Tested-by: Karunakar P <karunakarp@amiindia.co.in> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg/HttpDxe: Remove the unnecessary ASSERT.Jiaxin Wu2017-12-271-8/+1
| | | | | | | | | | Cc: Wang Fan <fan.wang@intel.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: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Wang Fan <fan.wang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg/HttpDxe: Fix the memory leak issue in HttpRequest().Jiaxin Wu2017-12-271-1/+7
| | | | | | | | | | Cc: Wang Fan <fan.wang@intel.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: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Wang Fan <fan.wang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg/TcpDxe: Check TCP payload for release version.Jiaxin Wu2017-12-272-32/+122
| | | | | | | | | | | | | | | | | TCP payload check is implemented by TcpVerifySegment(), but all the function calls of TcpVerifySegment() are placed in ASSERT(), which is only valid for debug version: ASSERT (TcpVerifySegment (Nbuf) != 0); This patch is to enable the check for release version. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wang Fan <fan.wang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg/TcpDxe: Remove the redundant code.Jiaxin Wu2017-12-262-66/+1
| | | | | | | | | | | | The function SockGroup() is not used by any other code. So, it can be deleted. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wang Fan <fan.wang@intel.com> Cc: Ye Ting <ting.ye@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg/TcpDxe: Check FragmentBuffer for NULL before useJiaxin Wu2017-12-261-0/+3
| | | | | | | | | | | | | According the Spec, the FragmentBuffers in FragmentTable are allocated by the application when calling Receive() function. This patch is to check whether the FragmentBuffer is valid or not. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wang Fan <fan.wang@intel.com> Cc: Ye Ting <ting.ye@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg/HttpBootDxe: Break the HttpBoot Callback function when meet ↵Jiaxin Wu2017-12-221-0/+1
| | | | | | | | | | | | | | | | redirect status. In HttpBootCallback(), when data type is HttpBootHttpResponse, function may meet the resource redirect error. In current implementation, function will still go ahead to find header for HTTP_HEADER_CONTENT_LENGTH, this is not expected. Function should break in redirect status error handling. Cc: Wang Fan <fan.wang@intel.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: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Wang Fan <fan.wang@intel.com>
* NetworkPkg/HttpBootDxe: Avoid the potential memory leak when eror happen.Jiaxin Wu2017-12-222-1/+8
| | | | | | | | | Cc: Wang Fan <fan.wang@intel.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: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Wang Fan <fan.wang@intel.com>
* NetworkPkg: Recycle the ICMP error message in PXE driver.Fu Siyuan2017-12-221-16/+14
| | | | | | | | | This patch updates PxeBcIcmpErrorDpcHandle() and PxeBcIcmp6ErrorDpcHandle() to recycle the ICMP packet after copy it to PXE mode data. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg: Remove redundant check in PXE driver.Fu Siyuan2017-12-221-15/+9
| | | | | | | | | | The IP protocol has been configured to only receive ICMP packet in PXE driver. So this patch removes the unnecessary check for NextHeader field and replace it with ASSERT. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>