summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network
AgeCommit message (Collapse)AuthorFilesLines
2019-05-27NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkgLiming Gao124-52538/+0
Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
2019-04-09MdeModulePkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney124-885/+124
https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2019-02-12MdeModulePkg/Ip4Dxe: Uninstall protocols when error happen in Driver Binding ↵Jiaxin Wu1-3/+6
Start. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1447 This patch is to uninstall Ip4ServiceBindingProtocol and Ip4Config2Protocol when error happen in Driver Binding Start. Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Signed-off-by: Michael Turner <Michael.Turner@microsoft.com> Reviewed-By: Ye Ting <ting.ye@intel.com>
2019-01-23MdeModulePkg/Dhcp4Dxe: Remove unnecessary NULL pointer check.Jiaxin Wu1-7/+4
v3: Add the instance token check. v2: The DHCP Instance might be destroyed in PxeDhcpDone. So, we need safe-delete. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1469 Since the value of Instance is retrieved from the list Entry, it can't be the NULL pointer, so just remove the unnecessary check. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Hao A <hao.a.wu@intel.com> Cc: Gao Liming <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Wu Hao A <hao.a.wu@intel.com>
2018-12-24MdeModulePkg: Delete UefiPxeBcDxe in MdeModulePkg.Siyuan Fu14-7904/+0
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1278 This patch is to delete the UefiPxeBcDxe driver in MdeModulePkg. The driver will not be maintained and can't co-work with the dual-stack UefiPxeBcDxe in NetworkPkg. People should use below NetworkPkg drivers instead: NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf Which is actively maintained with more bug fixes and new feature support. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Siyuan Fu <siyuan.fu@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2018-12-24MdeModulePkg: Delete IScsiDxe in MdeModulePkg.Siyuan Fu32-11845/+0
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1278 This patch is to delete the IScsiDxe driver in MdeModulePkg. The driver will not be maintained and can't co-work with the dual-stack IScsiDxe in NetworkPkg. People should use below NetworkPkg drivers instead: NetworkPkg/IScsiDxe/IScsiDxe.inf Which is actively maintained with more bug fixes and new feature support. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Siyuan Fu <siyuan.fu@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2018-12-24MdeModulePkg: Delete Tcp4Dxe in MdeModulePkg.Siyuan Fu22-12846/+0
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1278 This patch is to delete the Tcp4Dxe driver in MdeModulePkg. The driver will not be maintained and can't co-work with the dual-stack TcpDxe in NetworkPkg. People should use below NetworkPkg drivers instead: NetworkPkg/TcpDxe/TcpDxe.inf Which is actively maintained with more bug fixes and new feature support. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Siyuan Fu <siyuan.fu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2018-11-06MdeModulePkg/Mtftp4Dxe: Fix invalid configuration of MTFTP local port.Jiaxin Wu1-1/+1
This patch is to fix the invalid setting of MTFTP local port. The issue can be reproduced by tftp shell command by using [-l port] option. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2018-11-02MdeModulePkg: Remove the trailing space in three source files.Liming Gao1-1/+1
The recent changes in these three source files introduce the trailing space. This patch removes them to follow edk2 coding style. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-10-29MdeModulePke/Mtftp4Dxe: Correct the total received and saved block number.Jiaxin Wu5-17/+27
The block returned from Mtftp4RemoveBlockNum is not the total received and saved block number if it works in passive (Slave) mode. The issue was exposed by the EMS test. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
2018-10-09MdeModulePkg/Tcp4Dxe: Remove the trailing white space in one line.Jiaxin Wu1-3/+3
Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Bi Dandan <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2018-09-27MdeModulePkg/UefiPxeBcDxe: Add the clarification compared to UefiPxeBcDxe in ↵Jiaxin Wu1-1/+10
NetworkPkg. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1205 This patch is to add the driver usage/difference clarification compared to UefiPxeBcDxe in NetworkPkg. 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.1 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2018-09-27MdeModulePkg/IScsiDxe: Add the clarification compared to IScsiDxe in NetworkPkg.Jiaxin Wu1-1/+11
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1205 This patch is to add the driver usage/difference clarification compared to IScsiDxe in NetworkPkg. 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.1 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2018-09-27MdeModulePkg/Tcp4Dxe: Add the clarification compared to TcpDxe in NetworkPkg.Jiaxin Wu1-1/+11
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1205 This patch is to add the driver usage/difference clarification compared to TcpDxe in NetworkPkg. 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.1 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2018-09-27MdeModulePke/Mtftp4Dxe: Support windowsize in read request operation.Jiaxin Wu8-37/+89
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=886 This patch is to support the TFTP windowsize option described in RFC 7440. The feature allows the client and server to negotiate a window size of consecutive blocks to send as an alternative for replacing the single-block lockstep schema. Currently, the windowsize for write request operation is not supported since there is no real use cases. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Shao Ming <ming.shao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
2018-09-18MdeModulePkg/Ip4Dxe: Refine the coding style.Jiaxin Wu1-3/+3
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1180 Remove the trailing white spaces. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Bi Dandan <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
2018-09-13MdeModulePkg/Ip4Dxe: Sync the direct route entry setting.Jiaxin Wu2-10/+7
v2: use "IP & Netmask" directly instead of defining an additional variable. This patch is to sync the direct route entry setting in both the default and Instance route table {Subnet, Mask, NextHope} ( https://bugzilla.tianocore.org/show_bug.cgi?id=1143). Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 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>
2018-09-06MdeModulePkg: Removing ipf which is no longer supported from edk2.Chen A Chen12-14/+14
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: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@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: Star Zeng <star.zeng@intel.com>
2018-09-06MdeModulePkg: Remove trailing white spaceStar Zeng2-22/+22
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1144 Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
2018-09-03MdeModulePkg/Network: Add 32bit subnet mask support for IP4 PXE boot.Fu Siyuan8-27/+153
This patch updates IP4 stack to support 32bit subnet mask in PXE boot process. When 32bit subnet mask is used, the IP4 driver couldn't use the subnet mask to determine whether destination IP address is on-link or not, so it will always try to send all the packets to the destination IP address directly first, if failed it will continue to try the default gateway. Contributed-under: TianoCore Contribution Agreement 1.1 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>
2018-08-21MdeModulePkg Tcp4Dxe: Remove redundant functionsshenglei5-151/+0
The functions that are never called have been removed. They are SockRcvdErr,SockGroup and TcpPawsOK. https://bugzilla.tianocore.org/show_bug.cgi?id=1062 Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: shenglei <shenglei.zhang@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2018-08-21MdeModulePkg IScsiDxe: Remove a redundant functionshenglei1-31/+0
The function IScsiFindTcbByITT that is never called has been removed. https://bugzilla.tianocore.org/show_bug.cgi?id=1062 Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: shenglei <shenglei.zhang@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2018-08-21MdeModulePkg Ip4Dxe: Remove a redundant functionshenglei1-16/+0
The function Ip4Config2OnDhcp4Event that is never called has been removed. https://bugzilla.tianocore.org/show_bug.cgi?id=1062 Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: shenglei <shenglei.zhang@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2018-08-20MdeModulePkg: Remove redundant library classes and GUIDsshenglei2-2/+0
Some redundant library classes and GUIDs have been removed in inf, .c and .h files. https://bugzilla.tianocore.org/show_bug.cgi?id=1044 https://bugzilla.tianocore.org/show_bug.cgi?id=1045 https://bugzilla.tianocore.org/show_bug.cgi?id=1047 https://bugzilla.tianocore.org/show_bug.cgi?id=1049 https://bugzilla.tianocore.org/show_bug.cgi?id=1051 https://bugzilla.tianocore.org/show_bug.cgi?id=1052 https://bugzilla.tianocore.org/show_bug.cgi?id=1053 https://bugzilla.tianocore.org/show_bug.cgi?id=1054 https://bugzilla.tianocore.org/show_bug.cgi?id=1055 https://bugzilla.tianocore.org/show_bug.cgi?id=1056 https://bugzilla.tianocore.org/show_bug.cgi?id=1017 https://bugzilla.tianocore.org/show_bug.cgi?id=1035 https://bugzilla.tianocore.org/show_bug.cgi?id=1033 https://bugzilla.tianocore.org/show_bug.cgi?id=1012 https://bugzilla.tianocore.org/show_bug.cgi?id=1011 https://bugzilla.tianocore.org/show_bug.cgi?id=1062 v2: 1. Correct copyright year. 2. Fix alignment issue in AcpiPlatformDxe.inf. 3. Add DevicePathLib which is removed before in I2cHostDxe.inf. 4. Update NvmExpressPei.inf, NvmExpressPei.h, IScsiDxe.inf, IScsiDxe.inf, IScsiDxe.h, DxeMain.inf, DxeMain.h, PiSmmCore.inf and PiSmmCore.h for https://bugzilla.tianocore.org/show_bug.cgi?id=1062. v3: 1. Add https://bugzilla.tianocore.org/show_bug.cgi?id=1062 to the link list. 2. Remove DevicePathLib from I2cHostDxe.inf. 3. Update NvmExpressPei.inf, NvmExpressPei.h, UfsPciHcDxe.inf, UfsPciHcDxe.h, I2cHostDxe.inf, AtaBusDxe.inf, IScsiDxe.inf, IScsiDxe.h, DxeMain.inf, DxeMain.h, PiSmmCore.inf and PiSmmCore.h for https://bugzilla.tianocore.org/show_bug.cgi?id=1062. (Forget to add UfsPciHcDxe.inf, UfsPciHcDxe.h, AtaBusDxe.inf, and I2cHostDxe.inf previously.) Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: shenglei <shenglei.zhang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-06-28MdeModulePkg: Update IP4 driver to check for NULL pointer before using.Fu Siyuan1-20/+17
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> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
2018-06-28MdeModulePkg: Clean up source filesLiming Gao157-2103/+2103
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> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-06-21MdeModulePkg/NetworkPkg: Checking for NULL pointer before use.Fu Siyuan1-2/+5
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sivaraman Nainar <sivaramann@amiindia.co.in> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2018-03-13MdeModulePkg/Mtftp4Dxe: Fix the incorrect return status.Jiaxin Wu1-11/+11
The incorrect return status was caused by the commit of 39b0867d, which was to resolve the token status error that does not compliance with spec definition, but it results the protocol status not compliance with spec definition. This patch is to resolve above issue. 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> Reviewed-by: Wang, Fan <fan.wang@intel.com>
2018-03-03MdeModulePkg/Mtftp4Dxe: Separate the timer ticking to calculate the packet ↵Fu Siyuan5-21/+97
live time. TPL deadlock issue was enrolled by the commit of 39b0867d. To resolve the issue, this patch separated the timer ticking for all the MTFTP clients to calculate the packet live time in TPL_NOTIFY level. 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: Fu Siyuan <siyuan.fu@intel.com> 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>
2018-02-05MdeModulePkg/PXE: Add warning message for PXE if failed to read system GUID ↵Fu Siyuan1-1/+4
from 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>
2018-01-12MdeModulePkg/Ip4Dxe: Add an independent timer for reconfig checkingWang Fan3-22/+83
* Since wireless network can switch at very short time, the time interval of reconfig event checking is too long for this case. To achieve better performance and scalability, separate this task from Ip4 tick timer. Cc: Jiaxin Wu <jiaxin.wu@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: Wang Fan <fan.wang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2018-01-11MdeModulePkg/Dhcp4Dxe: Free NET_BUF data after sent out to avoid memory leakWang Fan2-27/+19
* When build a DHCP message in function DhcpSendMessage() or DhcpRetransmit(), a new NET_BUF is created by the library of NetbufFromExt, but it's not freed after it is sent out. This patch is to fix this memory leak issue. V2: * Since packet has already been referred by DhcpSb->LastPacket, and will be freed when sending another packet or clean up, there is no need to add an extra free function in NetbufFromExt. Cc: Jiaxin Wu <jiaxin.wu@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: Wang Fan <fan.wang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2018-01-10MdeModulePkg/IScsiDxe: Set ExitBootServiceEvent to NULL after close it.Jiaxin Wu1-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>
2018-01-10MdeModulePkg: Freed packet buffer when error occurs to avoid memory leak.Wang Fan1-1/+5
* In function Mtftp4WrqSendBlock(), when packet is not needed, function returns EFI_ABORTED but not freed the packet buffer. It results some memory leak and this patch is to fix this issue. Cc: Jiaxin Wu <jiaxin.wu@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: Wang Fan <fan.wang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2018-01-10MdeModulePkg: Fixed two issues when error occurs in Mtftp4Start.Wang Fan1-8/+12
* This function sets returned status as token status and signal token when error occurs, and it results token status not compliance with spec definition. This patch fixed this issue. * This function restore Tpl twice when Mtftp4WrqStart() returns an error, this patch fixed this issue. Cc: Jiaxin Wu <jiaxin.wu@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: Wang Fan <fan.wang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2018-01-03MdeModulePkg: Add error handling when IP address is Class EWang Fan1-3/+12
The Dhcp4.TransmitReceive() API should be able to use at any time according to UEFI spec. While in classless addressing network, the netmask must be explicitly provided together with the station address. But if the DHCP instance haven't be configured with a valid netmask, we need compute it according to the classful addressing rule. In such case, if the user configures with class E IP address, ASSERT will happen, we need to handle this case and return error status code. Cc: Jiaxin Wu <jiaxin.wu@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: Wang Fan <fan.wang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2017-12-22MdeModulePkg/Ip4Dxe: Clean up IP4 interface if failed to open ARP protocol.Fu Siyuan1-0/+1
This patch fixes a bug in Ip4ConfigProtocol, that new created IP interface is not freed if Open ARP protocol failed. Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
2017-12-22MdeModulePkg/Ip4Dxe: Remove redundant code in Ip4Config2InitInstance().Fu Siyuan1-12/+0
Instance->Dhcp4Event is not necessary to be created in Ip4Config2InitInstance. Because it will created in Ip4StartAutoConfig() later. Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
2017-12-18MdeModulePkg: Update Api from NetLibDetectMedia to NetLibDetectMediaWaitTimeout.fanwang27-16/+21
Since new Api NetLibDetectMediaWaitTimeout was involved to support connecting state handling, and it is forward compatible. So apply this Api in MdeModulePkg. V2: *Define time period in a macro instead of hard code. 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: Wang Fan <fan.wang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Signed-off-by: fanwang2 <fan.wang@intel.com>
2017-12-18MdeModulePkg/Ip4Dxe: return error on memory allocate failure instead of ASSERT.Fu Siyuan1-4/+15
This patch updates the IP4 driver to use error status code instead of ASSERT if failed to allocate memory buffer. Reviewed-by: Ye Ting <ting.ye@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
2017-12-13MdeModulePkg/Dhcp4Dxe: Check Media status before starting DHCP process.Jiaxin Wu1-1/+12
This patch is to resolve the issue reported @ https://bugzilla.tianocore.org/show_bug.cgi?id=804. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Karunakar P <karunakarp@amiindia.co.in> Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
2017-12-13MdeModulePkg/Ip4Dxe: Cleanup the resource after error happen during ↵Jiaxin Wu1-9/+37
Ip4StartAutoConfig(). 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>
2017-12-13MdeModulePkg/UefiPxeBcDxe: Discard the normal ICMP packets and recycle the ↵Jiaxin Wu1-7/+7
received ICMP data. This patch is to discard the normal ICMP packets and recycle the received ICMP data to avoid the memory leak. Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Heyi Guo <heyi.guo@linaro.org> Cc: Ye Ting <ting.ye@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Tested-by: Heyi Guo <heyi.guo@linaro.org> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2017-12-12MdeModulePkg/Ip4Dxe: fix ICMP echo reply memory leakHeyi Guo1-0/+3
When UEFI receives ICMP echo packets it will enter Ip4IcmpReplyEcho function, and then call Ip4Output. However, if Ip4Output gets some error and exits early, e.g. fails to find the route entry, memory buffer of "Data" gets no chance to be freed and memory leak will be caused. If there is such an attacker in the network, we will see UEFI runs out of memory and system hangs. So we explicitly free the memory when error status is returned. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Junbiao Hong <hongjunbiao@huawei.com> Signed-off-by: Heyi Guo <heyi.guo@linaro.org> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
2017-11-16MdeModulePkg/SNP: remove redundant DEBUG print in SNP Transmit.cFu Siyuan1-9/+13
This patch is to remove some redundant DEBUG output in SNP transmit function. In case of return EFI_NOT_READY in PxeTransmit, the SNP driver is indicate the caller that the transmit queue is full, it's a very common situation druing transmit, not a critical error. So the patch move the DEBUG lever to EFI_D_NET. 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>
2017-11-13MdeModulePkg: Update IP4 stack to support point-to-point link with 31-bit mask.Fu Siyuan1-21/+4
V2 update: Directly use NetIp4IsUnicast() to check station address in IP driver. This patch is to follow RFC3021 which allows to use 31-bit mask in point-to-point link. If a 31-bit subnet mask is assigned to a point-to-point link, it leaves the <Host-number> with only 1 bit. Consequently, only two possible addresses may result: {<Network-number>, 0} and {<Network-number>, -1} These addresses have historically been associated with network and broadcast addresses (see Section 2.2). In a point-to-point link with a 31-bit subnet mask, the two addresses above MUST be interpreted as host addresses. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
2017-10-26MdeModulePkg/Ip4Dxe: Trigger Ip4Config2 to retrieve the default address.Jiaxin Wu1-4/+21
According the UEFI spec 2.7 A: In section 28.3.2 for the IpConfigData.UseDefaultAddress, "While set to TRUE, Configure() will trigger the EFI_IP4_CONFIG2_PROTOCOL to retrieve the default IPv4 address if it is not available yet." In section 28.5 for the Ip4Config2PolicyDhcp, "...All of these configurations are retrieved from DHCP server or other auto-configuration mechanism." This patch is to align with the above description. When the default IPv4 address is not available and IpConfigData.UseDefaultAddress is set to TRUE, Ip4Config2 protocol will be called to retrieve the default address by setting the policy to Ip4Config2PolicyDhcp. 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>
2017-09-06MdeModulePkg: Fix GCC build error.Fu Siyuan1-1/+1
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2017-09-06MdeModulePkg/Ip4Dxe: fix a bug in IP4 driver for IpSec protocol notify.Fu Siyuan2-11/+13
The IP driver uses EfiCreateProtocolNotifyEvent() to register notify callback function for IpSec protocol, but it didn't notice that the callback will always be executed at least once, even the protocol wasn't in handle database. As a result, the Ip4IpSecProcessPacket() will still always call LocateProtocol() even the IpSec protocol is not installed, which will impact the network performance. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
2017-08-11MdeModulePkg/Ip4Dxe: Support SetData interface to clear specific configurationJiaxin Wu1-95/+190
UEFI Spec 2.7 adds the clarification on SetData interface usage to clear specific individual data types. This patch is to support this feature. 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: Ye Ting <ting.ye@intel.com>