Re: [edk2] [Patch 1/3] NetworkPkg: Update Api from NetLibDetectMedia to NetLibDetectMediaWaitTimeout.

2017-12-12 Thread Fu, Siyuan
Hi, Fan

We'd better to define a macro for the timeout, instead of using 20 in each 
place.

BestRegards
Fu Siyuan


> -Original Message-
> From: Wang, Fan
> Sent: Tuesday, December 12, 2017 4:54 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting...@intel.com>; Fu, Siyuan <siyuan...@intel.com>; Wu,
> Jiaxin <jiaxin...@intel.com>; Wang, Fan <fan.w...@intel.com>
> Subject: [Patch 1/3] NetworkPkg: Update Api from NetLibDetectMedia to
> NetLibDetectMediaWaitTimeout.
> 
> Since new Api NetLibDetectMediaWaitTimeout was involved to support
> connecting
> state handling, and it is forward compatible. So apply this Api in Network.
> 
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Cc: Wu Jiaxin <jiaxin...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wang Fan <fan.w...@intel.com>
> ---
>  NetworkPkg/DnsDxe/DnsDhcp.c   | 20 ++--
>  NetworkPkg/HttpBootDxe/HttpBootImpl.c | 10 +-
>  NetworkPkg/IScsiDxe/IScsiDhcp.c   | 11 ++-
>  NetworkPkg/IScsiDxe/IScsiDhcp6.c  | 11 ++-
>  NetworkPkg/IScsiDxe/IScsiProto.c  |  8 
>  NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c   | 10 +-
>  6 files changed, 36 insertions(+), 34 deletions(-)
> 
> diff --git a/NetworkPkg/DnsDxe/DnsDhcp.c b/NetworkPkg/DnsDxe/DnsDhcp.c
> index 93779be..604047c 100644
> --- a/NetworkPkg/DnsDxe/DnsDhcp.c
> +++ b/NetworkPkg/DnsDxe/DnsDhcp.c
> @@ -267,11 +267,11 @@ GetDns4ServerFromDhcp4 (
>)
>  {
>EFI_STATUS  Status;
>EFI_HANDLE  Image;
>EFI_HANDLE  Controller;
> -  BOOLEAN MediaPresent;
> +  EFI_STATUS  MediaStatus;
>EFI_HANDLE  MnpChildHandle;
>EFI_MANAGED_NETWORK_PROTOCOL*Mnp;
>EFI_MANAGED_NETWORK_CONFIG_DATA MnpConfigData;
>EFI_HANDLE  Dhcp4Handle;
>EFI_DHCP4_PROTOCOL  *Dhcp4;
> @@ -312,15 +312,15 @@ GetDns4ServerFromDhcp4 (
>DnsServerInfor.ServerCount = DnsServerCount;
> 
>IsDone = FALSE;
> 
>//
> -  // Check media.
> +  // Check media status, wait no more than 20 seconds
>//
> -  MediaPresent = TRUE;
> -  NetLibDetectMedia (Controller, );
> -  if (!MediaPresent) {
> +  MediaStatus = EFI_SUCCESS;
> +  NetLibDetectMediaWaitTimeout (Controller, EFI_TIMER_PERIOD_SECONDS(20),
> );
> +  if (MediaStatus != EFI_SUCCESS) {
>  return EFI_NO_MEDIA;
>}
> 
>//
>// Create a Mnp child instance, get the protocol and config for it.
> @@ -618,11 +618,11 @@ GetDns6ServerFromDhcp6 (
>EFI_STATUSStatus;
>EFI_STATUSTimerStatus;
>EFI_DHCP6_PACKET_OPTION   *Oro;
>EFI_DHCP6_RETRANSMISSION  InfoReqReXmit;
>EFI_EVENT Timer;
> -  BOOLEAN   MediaPresent;
> +  EFI_STATUSMediaStatus;
>DNS6_SERVER_INFOR DnsServerInfor;
> 
>Dhcp6Handle = NULL;
>Dhcp6   = NULL;
>Oro = NULL;
> @@ -631,15 +631,15 @@ GetDns6ServerFromDhcp6 (
>ZeroMem (, sizeof (DNS6_SERVER_INFOR));
> 
>DnsServerInfor.ServerCount = DnsServerCount;
> 
>//
> -  // Check media status before doing DHCP.
> +  // Check media, wait no more than 20 seconds
>//
> -  MediaPresent = TRUE;
> -  NetLibDetectMedia (Controller, );
> -  if (!MediaPresent) {
> +  MediaStatus = EFI_SUCCESS;
> +  NetLibDetectMediaWaitTimeout (Controller, EFI_TIMER_PERIOD_SECONDS(20),
> );
> +  if (MediaStatus != EFI_SUCCESS) {
>  return EFI_NO_MEDIA;
>}
> 
>//
>// Create a DHCP6 child instance and get the protocol.
> diff --git a/NetworkPkg/HttpBootDxe/HttpBootImpl.c
> b/NetworkPkg/HttpBootDxe/HttpBootImpl.c
> index d591db5..05fea28 100644
> --- a/NetworkPkg/HttpBootDxe/HttpBootImpl.c
> +++ b/NetworkPkg/HttpBootDxe/HttpBootImpl.c
> @@ -546,11 +546,11 @@ HttpBootDxeLoadFile (
>IN VOID *Buffer OPTIONAL
>)
>  {
>HTTP_BOOT_PRIVATE_DATA*Private;
>HTTP_BOOT_VIRTUAL_NIC *VirtualNic;
> -  BOOLEAN   MediaPresent;
> +  EFI_STATUSMediaStatus;
>BOOLEAN   UsingIpv6;
>EFI_STATUSStatus;
>HTTP_BOOT_IMAGE_TYPE  ImageType;
> 
>if (This == NULL || BufferSize == NULL || FilePath == NULL) {
> @@ -566,15 +566,15 @@ HttpBootDxeLoadFile (
> 
>VirtualNic = HTTP_BOOT_VIRTUAL_NIC_FROM_LOADFILE (This);
>Private = VirtualNic->Priv

[edk2] [Patch] MdeModulePkg/Ip4Dxe: Clean up IP4 interface if failed to open ARP protocol.

2017-12-12 Thread Fu Siyuan
This patch fixes a bug in Ip4ConfigProtocol, that new created IP interface is
not freed if Open ARP protocol failed.

Cc: Ye Ting <ting...@intel.com>
Cc: Wu Jiaxin <jiaxin...@intel.com>
Cc: Wang Fan <fan.w...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan...@intel.com>
---
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c 
b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
index fc5812e4ab..ac48ad2584 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
@@ -727,6 +727,7 @@ Ip4ConfigProtocol (
 EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
 );
 if (EFI_ERROR (Status)) {
+  Ip4FreeInterface (IpIf, IpInstance);
   goto ON_ERROR;
 }
   }
-- 
2.13.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] MdeModulePkg/Ip4Dxe: Remove redundant code in Ip4Config2InitInstance().

2017-12-12 Thread Fu Siyuan
Instance->Dhcp4Event is not necessary to be created in Ip4Config2InitInstance.
Because it will created in Ip4StartAutoConfig() later.

Cc: Ye Ting <ting...@intel.com>
Cc: Wu Jiaxin <jiaxin...@intel.com>
Cc: Wang Fan <fan.w...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan...@intel.com>
---
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c | 12 
 1 file changed, 12 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c 
b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
index 26530e3a2b..9925ae9203 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
@@ -2034,18 +2034,6 @@ Ip4Config2InitInstance (
   DataItem->SetData  = Ip4Config2SetDnsServer;
   DataItem->Status   = EFI_NOT_FOUND;
 
-  //
-  // Create the event used for DHCP.
-  //
-  Status = gBS->CreateEvent (
-  EVT_NOTIFY_SIGNAL,
-  TPL_CALLBACK,
-  Ip4Config2OnDhcp4Event,
-  Instance,
-  >Dhcp4Event
-  );
-  ASSERT_EFI_ERROR (Status);
-
   Instance->Configured  = TRUE;
 
   //
-- 
2.13.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] MdeModulePkg/Ip4Dxe: return error on memory allocate failure instead of ASSERT.

2017-12-12 Thread Fu Siyuan
This patch updates the IP4 driver to use error status code instead of ASSERT
if failed to allocate memory buffer.

Cc: Ye Ting <ting...@intel.com>
Cc: Wu Jiaxin <jiaxin...@intel.com>
Cc: Wang Fan <fan.w...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan...@intel.com>
---
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Nv.c | 19 +++
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Nv.c 
b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Nv.c
index c8dc6976d7..694a2d0e1f 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Nv.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Nv.c
@@ -293,8 +293,12 @@ Ip4Config2IpToStr (
   @param[in]   IpCount   The size of IPv4 address list.
   @param[out]  Str   The string contains several decimal dotted
  IPv4 addresses separated by space.   
+
+  @retval EFI_SUCCESS   Operation is success.
+  @retval EFI_OUT_OF_RESOURCES  Error occurs in allocating memory.
+
 **/
-VOID
+EFI_STATUS
 Ip4Config2IpListToStr (
   IN  EFI_IPv4_ADDRESS  *Ip,
   IN  UINTN IpCount,
@@ -317,7 +321,9 @@ Ip4Config2IpListToStr (
 TempIp = Ip + Index;
 if (TempStr == NULL) {
   TempStr = AllocateZeroPool(2 * IP4_STR_MAX_SIZE);
-  ASSERT(TempStr != NULL);
+  if (TempStr == NULL) {
+return EFI_OUT_OF_RESOURCES;
+  }
 }
 
 UnicodeSPrint (
@@ -347,6 +353,8 @@ Ip4Config2IpListToStr (
   if (TempStr != NULL) {
 FreePool(TempStr);
   }
+
+  return EFI_SUCCESS;
 }
 
 /**
@@ -518,7 +526,7 @@ Ip4Config2ConvertConfigNvDataToIfrNvData (
   Ip4Config2IpToStr (>StationAddress, IfrNvData->StationAddress);
   Ip4Config2IpToStr (>SubnetMask, IfrNvData->SubnetMask);
   Ip4Config2IpToStr (, IfrNvData->GatewayAddress);
-  Ip4Config2IpListToStr (DnsAddress, DnsCount, IfrNvData->DnsAddress);
+  Status = Ip4Config2IpListToStr (DnsAddress, DnsCount, IfrNvData->DnsAddress);
 
 Exit:
 
@@ -914,7 +922,10 @@ Ip4FormExtractConfig (
   ConfigRequestHdr = HiiConstructConfigHdr (, 
mIp4Config2StorageName, Private->ChildHandle);
   Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16);
   ConfigRequest = AllocateZeroPool (Size);
-  ASSERT (ConfigRequest != NULL);
+  if (ConfigRequest == NULL) {
+Status = EFI_OUT_OF_RESOURCES;
+goto Failure;
+  }
   AllocatedRequest = TRUE;
   
   UnicodeSPrint (ConfigRequest, Size, L"%s=0=%016LX", 
ConfigRequestHdr, (UINT64)BufferSize);
-- 
2.13.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] MdeModulePkg/IpIoLib: return error instead of ASSERT if input parameter is incorrect.

2017-12-12 Thread Fu Siyuan
This patch updates the DxeIpIoLib to return EFI_INVALID_PARAMETER instead of
ASSERT if the input pointers are not correct.

Cc: Ye Ting <ting...@intel.com>
Cc: Wu Jiaxin <jiaxin...@intel.com>
Cc: Wang Fan <fan.w...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan...@intel.com>
---
 MdeModulePkg/Include/Library/IpIoLib.h   | 24 +---
 MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c | 12 ++--
 2 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/MdeModulePkg/Include/Library/IpIoLib.h 
b/MdeModulePkg/Include/Library/IpIoLib.h
index aab0c68059..0bebdb73b5 100644
--- a/MdeModulePkg/Include/Library/IpIoLib.h
+++ b/MdeModulePkg/Include/Library/IpIoLib.h
@@ -2,7 +2,7 @@
   This library is only intended to be used by UEFI network stack modules.
   It provides the combined IpIo layer on the EFI IP4 Protocol and EFI IP6 
protocol.
 
-Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
 This program and the accompanying materials are licensed and made available 
under 
 the terms and conditions of the BSD License that accompanies this 
distribution.  
 The full text of the license may be found at
@@ -399,23 +399,25 @@ IpIoOpen (
   Send out an IP packet.
   
   This function is called after IpIoOpen(). The data to be sent are wrapped in
-  Pkt. The IP instance wrapped in IpIo is used for sending by default, but can 
be
-  overriden by Sender. Other sending configurations, such as source address 
and gateway
-  address, are specified in OverrideData.
+  Pkt. The IP instance wrapped in IpIo is used for sending by default but can 
be
+  overriden by Sender. Other sending configs, like source address and gateway
+  address etc., are specified in OverrideData.
 
-  @param[in, out]  IpIo  The pointer to an IP_IO instance used 
for sending IP
+  @param[in, out]  IpIo  Pointer to an IP_IO instance used for 
sending IP
  packet.
-  @param[in, out]  Pkt   The pointer to the IP packet to be 
sent.
-  @param[in]   SenderOptional. The IP protocol instance 
used for sending.
-  @param[in]   Context   The optional context data.
-  @param[in]   NotifyDataThe optional notify data.
+  @param[in, out]  Pkt   Pointer to the IP packet to be sent.
+  @param[in]   SenderThe IP protocol instance used for 
sending.
+  @param[in]   Context   Optional context data.
+  @param[in]   NotifyDataOptional notify data.
   @param[in]   Dest  The destination IP address to send 
this packet to.
+ This parameter is optional when using 
IPv6.
   @param[in]   OverrideData  The data to override some 
configuration of the IP
  instance used for sending.
 
-  @retval  EFI_SUCCESS   The operation completed successfully.
+  @retval  EFI_SUCCESS   The operation is completed 
successfully.
+  @retval  EFI_INVALID_PARAMETER The input parameter is not correct.
   @retval  EFI_NOT_STARTED   The IpIo is not configured.
-  @retval  EFI_OUT_OF_RESOURCES  Failed due to resource limitations.
+  @retval  EFI_OUT_OF_RESOURCES  Failed due to resource limit.
 
 **/
 EFI_STATUS
diff --git a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c 
b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
index abc07fb0ff..cd9bc3bd54 100644
--- a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
+++ b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
@@ -2,7 +2,7 @@
   IpIo Library.
 
 (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
-Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -1524,10 +1524,12 @@ IpIoDestroy (
   @param[in]   Context   Optional context data.
   @param[in]   NotifyDataOptional notify data.
   @param[in]   Dest  The destination IP address to send 
this packet to.
+ This parameter is optional when using 
IPv6.
   @param[in]   OverrideData  The data to override some 
configuration of the IP
  instance used for sending.
 
   @retval  EFI_SUCCESS   The operation is completed 
successfully.
+  @retval  EFI_INVALID_PARAMETER The input parameter is not correct.
   @retval  EFI_NOT_STARTED   The IpIo is not configured.
   @retval  

[edk2] [Patch] MdeModulePkg/IpIoLib: add more error handling code to DxeIpIoLib.

2017-12-12 Thread Fu Siyuan
In DxeIpIo, there are several places not check the returned value of called 
functions.
This patch is to add the error handling to these functions.

Cc: Ye Ting <ting...@intel.com>
Cc: Wu Jiaxin <jiaxin...@intel.com>
Cc: Wang Fan <fan.w...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan...@intel.com>
---
 MdeModulePkg/Include/Library/IpIoLib.h   |  4 +-
 MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c | 83 +---
 2 files changed, 54 insertions(+), 33 deletions(-)

diff --git a/MdeModulePkg/Include/Library/IpIoLib.h 
b/MdeModulePkg/Include/Library/IpIoLib.h
index aab0c68059..a8496f729d 100644
--- a/MdeModulePkg/Include/Library/IpIoLib.h
+++ b/MdeModulePkg/Include/Library/IpIoLib.h
@@ -2,7 +2,7 @@
   This library is only intended to be used by UEFI network stack modules.
   It provides the combined IpIo layer on the EFI IP4 Protocol and EFI IP6 
protocol.
 
-Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
 This program and the accompanying materials are licensed and made available 
under 
 the terms and conditions of the BSD License that accompanies this 
distribution.  
 The full text of the license may be found at
@@ -426,7 +426,7 @@ IpIoSend (
   IN IP_IO_IP_INFO  *SenderOPTIONAL,
   IN VOID   *Context   OPTIONAL,
   IN VOID   *NotifyDataOPTIONAL,
-  IN EFI_IP_ADDRESS *Dest,
+  IN EFI_IP_ADDRESS *Dest  OPTIONAL,
   IN IP_IO_OVERRIDE *OverrideData  OPTIONAL
   );
 
diff --git a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c 
b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
index abc07fb0ff..6f312cccb2 100644
--- a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
+++ b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
@@ -2,7 +2,7 @@
   IpIo Library.
 
 (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
-Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -234,24 +234,25 @@ IpIoCloseProtocolDestroyIpChild (
   //
   // Close the previously openned IP protocol.
   //
-  gBS->CloseProtocol (
- ChildHandle,
- IpProtocolGuid,
- ImageHandle,
- ControllerHandle
- );
+  Status = gBS->CloseProtocol (
+  ChildHandle,
+  IpProtocolGuid,
+  ImageHandle,
+  ControllerHandle
+  );
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
 
   //
   // Destroy the IP child.
   //
-  Status = NetLibDestroyServiceChild (
- ControllerHandle,
- ImageHandle,
- ServiceBindingGuid,
- ChildHandle
- );
-
-  return Status;
+  return NetLibDestroyServiceChild (
+   ControllerHandle,
+   ImageHandle,
+   ServiceBindingGuid,
+   ChildHandle
+   );
 }
 
 /**
@@ -377,8 +378,14 @@ IpIoIcmpv4Handler (
   TrimBytes  = (UINT32) (PayLoadHdr - (UINT8 *) IcmpHdr);
 
   NetbufTrim (Pkt, TrimBytes, TRUE);
-
-  IpIo->PktRcvdNotify (EFI_ICMP_ERROR, IcmpErr, Session, Pkt, 
IpIo->RcvdContext);
+  
+  //
+  // If the input packet has invalid format, and TrimBytes is larger than 
+  // the packet size, the NetbufTrim might trim the packet to zero.
+  //
+  if (Pkt->TotalSize != 0) {
+IpIo->PktRcvdNotify (EFI_ICMP_ERROR, IcmpErr, Session, Pkt, 
IpIo->RcvdContext);
+  }
 
   return EFI_SUCCESS;  
 }
@@ -539,7 +546,13 @@ IpIoIcmpv6Handler (
   
   NetbufTrim (Pkt, TrimBytes, TRUE);
 
-  IpIo->PktRcvdNotify (EFI_ICMP_ERROR, IcmpErr, Session, Pkt, 
IpIo->RcvdContext);
+  //
+  // If the input packet has invalid format, and TrimBytes is larger than 
+  // the packet size, the NetbufTrim might trim the packet to zero.
+  //
+  if (Pkt->TotalSize != 0) {
+IpIo->PktRcvdNotify (EFI_ICMP_ERROR, IcmpErr, Session, Pkt, 
IpIo->RcvdContext);
+  }
 
   return EFI_SUCCESS;
 }
@@ -1540,7 +1553,7 @@ IpIoSend (
   IN IP_IO_IP_INFO  *SenderOPTIONAL,
   IN VOID   *Context   OPTIONAL,
   IN VOID   *NotifyDataOPTIONAL,
-  IN EFI_IP_ADDRESS *Dest,
+  IN EFI_IP_ADDRESS *Dest  OPTIONAL,
   IN IP_IO_OVERRIDE *OverrideData  OPTIONAL
   )
 {
@@ -1791,7 +1804,7 @@ IpIoConfigIp (
   }
 
   if (IpConfigData != NULL) {
-if (IpInfo->IpVersion == IP_VERSION_4){
+if (IpInfo->IpVersion == IP_VERSION_4) {
 
   if (((EFI_IP4_CONFIG_DATA *) IpConfigData)->UseDefaultAddress) {
 Ip.Ip4->GetModeData (
@@ -1800,10 +1813,14 @@ IpIoConfigIp (
   NULL, 
   NULL
 

[edk2] [Patch] MdeModulePkg/IpIoDxe: Update API description to match the function implementation.

2017-12-12 Thread Fu Siyuan
This patch updates some API descriptions in DxeIpIoLib to match the real
implementation.

Cc: Ye Ting <ting...@intel.com>
Cc: Wu Jiaxin <jiaxin...@intel.com>
Cc: Wang Fan <fan.w...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan...@intel.com>
---
 MdeModulePkg/Include/Library/IpIoLib.h   |  4 
 MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c | 34 +---
 2 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/MdeModulePkg/Include/Library/IpIoLib.h 
b/MdeModulePkg/Include/Library/IpIoLib.h
index aab0c68059..ecb3f11e5c 100644
--- a/MdeModulePkg/Include/Library/IpIoLib.h
+++ b/MdeModulePkg/Include/Library/IpIoLib.h
@@ -385,6 +385,7 @@ IpIoStop (
   successfully.
   @retval  EFI_ACCESS_DENIED  The IP_IO instance is configured; avoid  
   reopening it.
+  @retval  EFI_UNSUPPORTEDIPv4 RawData mode is no supported.
   @retval  Others An error condition occurred.
 
 **/
@@ -416,6 +417,7 @@ IpIoOpen (
   @retval  EFI_SUCCESS   The operation completed successfully.
   @retval  EFI_NOT_STARTED   The IpIo is not configured.
   @retval  EFI_OUT_OF_RESOURCES  Failed due to resource limitations.
+  @retval  OthersError condition occurred.
 
 **/
 EFI_STATUS
@@ -541,6 +543,7 @@ IpIoFindSender (
   @param[out]  IsHardIf TRUE, indicates that it is a hard 
error.
   @param[out]  NotifyIf TRUE, SockError needs to be notified.
 
+  @retval EFI_UNSUPPORTEDUnrecognizable ICMP error code
   @return The ICMP Error Status, such as EFI_NETWORK_UNREACHABLE.
 
 **/
@@ -574,6 +577,7 @@ IpIoGetIcmpErrStatus (
   @retval  EFI_INVALID_PARAMETER The Neighbor Address is invalid.
   @retval  EFI_NOT_FOUND The neighbor cache entry is not in the 
  neighbor table.  
+  @retval  EFI_UNSUPPORTED   IP version is IPv4, which doesn't support 
neighbor cache refresh.
   @retval  EFI_OUT_OF_RESOURCES  Failed due to resource limitations.
 
 **/
diff --git a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c 
b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
index abc07fb0ff..c880818d42 100644
--- a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
+++ b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
@@ -129,6 +129,7 @@ IpIoTransmitHandler (
 
   @retval   EFI_SUCCESSThe IP child is created and the IP protocol
interface is retrieved.
+  @retval   EFI_UNSUPPORTEDUpsupported IpVersion.
   @retval   Others The required operation failed.
 
 **/
@@ -206,6 +207,7 @@ IpIoCreateIpChildOpenProtocol (
 
   @retval EFI_SUCCESS The IP protocol is closed and the relevant 
IP child
   is destroyed.
+  @retval EFI_UNSUPPORTED Upsupported IpVersion.
   @retval Others  The required operation failed.
 
 **/
@@ -1276,6 +1278,7 @@ ReleaseIpIo:
   successfully.
   @retval  EFI_ACCESS_DENIED  The IP_IO instance is configured, avoid 
to 
   reopen it.
+  @retval  EFI_UNSUPPORTEDIPv4 RawData mode is no supported.
   @retval  Others Error condition occurred.
 
 **/
@@ -1488,20 +1491,28 @@ IpIoDestroy (
   IN OUT IP_IO *IpIo
   )
 {
+  EFI_STATUSStatus;
+  
   //
   // Stop the IpIo.
   //
-  IpIoStop (IpIo);
+  Status = IpIoStop (IpIo);
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
 
   //
   // Close the IP protocol and destroy the child.
   //
-  IpIoCloseProtocolDestroyIpChild (
-IpIo->Controller,
-IpIo->Image,
-IpIo->ChildHandle,
-IpIo->IpVersion
-);
+  Status = IpIoCloseProtocolDestroyIpChild (
+ IpIo->Controller,
+ IpIo->Image,
+ IpIo->ChildHandle,
+ IpIo->IpVersion
+ );
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
 
   gBS->FreePool (IpIo);
 
@@ -1530,6 +1541,7 @@ IpIoDestroy (
   @retval  EFI_SUCCESS   The operation is completed 
successfully.
   @retval  EFI_NOT_STARTED   The IpIo is not configured.
   @retval  EFI_OUT_OF_RESOURCES  Failed due to resource limit.
+  @retval  OthersError condition occurred.
 
 **/
 EFI_STATUS
@@ -2044,6 +2056,7 @@ IpIoFindSender (
   @param[out]  IsHardIf TRUE, indicates that it is a hard 
error.
   @param[out]  NotifyIf TRUE, SockError needs to be notified.
 
+  @retval EFI_UNSUPPORTEDUnrecognizable ICMP error code.
   @return ICMP Error Status, such as EFI_NETWORK_UNREACHABLE.
 
 **/
@@ -2162,6 +2175,7 @@ IpIoGetIcmpErrStatus (
   @retval  EFI_INVALID_PARAMETER Neighbo

Re: [edk2] [Patch 0/2] Check Media status before starting DHCP process.

2017-12-03 Thread Fu, Siyuan
Hi, Jiaxin

If the network cable is plug-in after this error returned, will the IP/DHCP 
driver restart DHCP process to request an address automatically?


BestRegards
Fu Siyuan


> -Original Message-
> From: Wu, Jiaxin
> Sent: Friday, December 1, 2017 4:39 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting...@intel.com>; Fu, Siyuan <siyuan...@intel.com>;
> Karunakar P <karunak...@amiindia.co.in>; Wu, Jiaxin <jiaxin...@intel.com>
> Subject: [Patch 0/2] Check Media status before starting DHCP process.
> 
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Karunakar P <karunak...@amiindia.co.in>
> Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
> 
> Jiaxin Wu (2):
>   MdeModulePkg/Dhcp4Dxe: Check Media status before starting DHCP
> process.
>   NetworkPkg/Dhcp6Dxe: Check Media status before starting DHCP process.
> 
>  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c | 13 -
>  NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c | 14 +-
>  2 files changed, 25 insertions(+), 2 deletions(-)
> 
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [RFC] MdeModulePkg/Ip4Dxe: fix ICMP echo reply memory leak

2017-12-06 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>

> -Original Message-
> From: Heyi Guo [mailto:heyi@linaro.org]
> Sent: Thursday, December 7, 2017 10:22 AM
> To: linaro-u...@lists.linaro.org; edk2-devel@lists.01.org
> Cc: Heyi Guo <heyi@linaro.org>; Junbiao Hong <hongjunb...@huawei.com>;
> Zeng, Star <star.z...@intel.com>; Dong, Eric <eric.d...@intel.com>; Ni,
> Ruiyu <ruiyu...@intel.com>; Fu, Siyuan <siyuan...@intel.com>; Wu, Jiaxin
> <jiaxin...@intel.com>
> Subject: [RFC] MdeModulePkg/Ip4Dxe: fix ICMP echo reply memory leak
> 
> When UEFI receives IPMP 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.
> 
> Network stack code is so complicated that this is just a RFC to fix
> this issue. Please provide your comments about this.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Junbiao Hong <hongjunb...@huawei.com>
> Signed-off-by: Heyi Guo <heyi@linaro.org>
> Cc: Star Zeng <star.z...@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Ruiyu Ni <ruiyu...@intel.com>
> Cc: Siyuan Fu <siyuan...@intel.com>
> Cc: Jiaxin Wu <jiaxin...@intel.com>
> ---
>  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c
> b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c
> index b4b0864..ed6bdbe 100644
> --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c
> +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c
> @@ -267,6 +267,9 @@ Ip4IcmpReplyEcho (
>   Ip4SysPacketSent,
>   NULL
>   );
> +  if (EFI_ERROR (Status)) {
> +NetbufFree (Data);
> +  }
> 
>  ON_EXIT:
>NetbufFree (Packet);
> --
> 2.7.4

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch v2] MdeModulePkg: Free NET_BUF data after it is sent out to avoid memory leak

2017-12-10 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>

> -Original Message-
> From: Wang, Fan
> Sent: Monday, November 27, 2017 2:44 PM
> To: edk2-devel@lists.01.org
> Cc: Wu, Jiaxin <jiaxin...@intel.com>; Ye, Ting <ting...@intel.com>; Fu,
> Siyuan <siyuan...@intel.com>; Wang, Fan <fan.w...@intel.com>
> Subject: [Patch v2] MdeModulePkg: Free NET_BUF data after it is sent out
> to avoid memory leak
> 
> 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...@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wang Fan <fan.w...@intel.com>
> ---
>  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h | 12 
>  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c   | 13 +
>  2 files changed, 17 insertions(+), 8 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h
> b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h
> index e546a08..57f6d5e 100644
> --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h
> +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h
> @@ -182,10 +182,22 @@ VOID
>  DhcpCleanConfigure (
>IN OUT EFI_DHCP4_CONFIG_DATA  *Config
>);
> 
>  /**
> +  Callback of Dhcp packet. Does nothing.
> +
> +  @param Arg   The context.
> +
> +**/
> +VOID
> +EFIAPI
> +DhcpDummyExtFree (
> +  IN VOID   *Arg
> +  );
> +
> +/**
>Set the elapsed time based on the given instance and the pointer to the
>elapsed time option.
> 
>@param[in]  Elapsed   The pointer to the position to append.
>@param[in]  Instance  The pointer to the Dhcp4 instance.
> diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c
> b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c
> index 3898223..54a610a 100644
> --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c
> +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c
> @@ -1357,17 +1357,16 @@ DhcpSendMessage (
>  >ClientAddressSendOut[0],
>  >Dhcp4.Header.ClientHwAddr[0],
>  Packet->Dhcp4.Header.HwAddrLen
>  );
> 
> -
>//
>// Wrap it into a netbuf then send it.
>//
>Frag.Bulk = (UINT8 *) >Dhcp4.Header;
>Frag.Len  = Packet->Length;
> -  Wrap  = NetbufFromExt (, 1, 0, 0, DhcpReleasePacket, Packet);
> +  Wrap  = NetbufFromExt (, 1, 0, 0, DhcpDummyExtFree, NULL);
> 
>if (Wrap == NULL) {
>  FreePool (Packet);
>  return EFI_OUT_OF_RESOURCES;
>}
> @@ -1397,11 +1396,10 @@ DhcpSendMessage (
>  EndPoint.LocalAddr.Addr[0]  = DhcpSb->ClientAddr;
>  UdpIo   = DhcpSb->LeaseIoPort;
>}
> 
>ASSERT (UdpIo != NULL);
> -  NET_GET_REF (Wrap);
> 
>Status = UdpIoSendDatagram (
>   UdpIo,
>   Wrap,
>   ,
> @@ -1409,11 +1407,11 @@ DhcpSendMessage (
>   DhcpOnPacketSent,
>   DhcpSb
>   );
> 
>if (EFI_ERROR (Status)) {
> -NET_PUT_REF (Wrap);
> +NetbufFree (Wrap);
>  return EFI_ACCESS_DENIED;
>}
> 
>return EFI_SUCCESS;
>  }
> @@ -1452,16 +1450,16 @@ DhcpRetransmit (
>//
>// Wrap it into a netbuf then send it.
>//
>Frag.Bulk = (UINT8 *) >LastPacket->Dhcp4.Header;
>Frag.Len  = DhcpSb->LastPacket->Length;
> -  Wrap  = NetbufFromExt (, 1, 0, 0, DhcpReleasePacket, DhcpSb-
> >LastPacket);
> +  Wrap  = NetbufFromExt (, 1, 0, 0, DhcpDummyExtFree, NULL);
> 
>if (Wrap == NULL) {
>  return EFI_OUT_OF_RESOURCES;
>}
> -
> +
>//
>// Broadcast the message, unless we know the server address.
>//
>EndPoint.RemotePort = DHCP_SERVER_PORT;
>EndPoint.LocalPort  = DHCP_CLIENT_PORT;
> @@ -1475,22 +1473,21 @@ DhcpRetransmit (
>  UdpIo   = DhcpSb->LeaseIoPort;
>}
> 
>ASSERT (UdpIo != NULL);
> 
> -  NET_GET_REF (Wrap);
>Status = UdpIoSendDatagram (
>   UdpIo,
>   Wrap,
>   ,
>   NULL,
>   DhcpOnPacketSent,
>   DhcpSb
>   );
> 
>if (EFI_ERROR (Status)) {
> -NET_PUT_REF (Wrap);
> +NetbufFree (Wrap);
>  return EFI_ACCESS_DENIED;
>}
> 
>return EFI_SUCCESS;
>  }
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [RFC PATCH] ArmPkg: add driver to add distro installer HTTP boot options

2017-10-24 Thread Fu, Siyuan
Hi, Leif and Laszlo

The HTTP restriction is actually not supported now. If server replies a HTTP 
redirect response, the current HTTP boot driver will only print new URL address 
on the screen then abort the HTTP boot. It won't attempt to download the image 
from the new address.

BestRegards
Fu Siyuan


> -Original Message-
> From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> Sent: Tuesday, October 24, 2017 10:44 PM
> To: Laszlo Ersek <ler...@redhat.com>
> Cc: edk2-devel@lists.01.org; daniel.thomp...@linaro.org; Ard Biesheuvel
> <ard.biesheu...@linaro.org>; Fu, Siyuan <siyuan...@intel.com>; Wu, Jiaxin
> <jiaxin...@intel.com>
> Subject: Re: [edk2] [RFC PATCH] ArmPkg: add driver to add distro installer
> HTTP boot options
> 
> On Tue, Oct 24, 2017 at 03:32:51PM +0200, Laszlo Ersek wrote:
> > > Convenience. And given that I only noticed yesterday that the boot
> > > fails on HTTP redirects, of somewhat restricted value.
> > >
> > > Is that an official policy decision, or just a restriction of the
> > > implementation?
> >
> > Hm, I'm unsure; the following seems to imply that HttpBootDxe intends to
> handle redirects:
> >
> > if (HttpBootIsHttpRedirectStatusCode (HttpMessage-
> >Data.Response->StatusCode)) {
> >   //
> >   // Server indicates the resource has been redirected to a
> different URL
> >   // according to the section 6.4 of RFC7231 and the RFC 7538.
> >   // Display the redirect information on the screen.
> >   //
> >   HttpHeader = HttpFindHeader (
> >  HttpMessage->HeaderCount,
> >  HttpMessage->Headers,
> >  HTTP_HEADER_LOCATION
> >  );
> >   if (HttpHeader != NULL) {
> > Print (L"\n  HTTP ERROR: Resource Redirected.\n  New
> Location: %a\n", HttpHeader->FieldValue);
> >   }
> >
> > Can you perhaps capture a packet trace and discuss it with Siyuan
> > and Jiaxin? Perhaps the server returns a status code that is not
> > handled by HttpBootDxe right now.
> 
> Oh, it's explicitly printed as a 302 (Found), detected by
> HttpBootDxe/HttpBootSupport.c:HttpBootPrintErrorMessage().
> 
> See https://www.mail-archive.com/edk2-devel@lists.01.org/msg27819.html
> 
> But yes, I should have cc:d Siyuan and Jiaxin (and have now done so).
> Can you comment?
> 
> Regards,
> 
> Leif
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] MdeModulePkg/Ip4Dxe: Trigger Ip4Config2 to retrieve the default address.

2017-10-25 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jiaxin Wu
> Sent: Friday, October 20, 2017 2:51 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting...@intel.com>; Fu, Siyuan <siyuan...@intel.com>; Wu,
> Jiaxin <jiaxin...@intel.com>
> Subject: [edk2] [Patch] MdeModulePkg/Ip4Dxe: Trigger Ip4Config2 to
> retrieve the default address.
> 
> 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...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
> ---
>  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c | 25
> +
>  1 file changed, 21 insertions(+), 4 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
> b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
> index 3cdf8ec..fc5812e 100644
> --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
> +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
> @@ -594,13 +594,17 @@ Ip4ConfigProtocol (
>IP4_INTERFACE *IpIf;
>EFI_STATUSStatus;
>IP4_ADDR  Ip;
>IP4_ADDR  Netmask;
>EFI_ARP_PROTOCOL  *Arp;
> +  EFI_IP4_CONFIG2_PROTOCOL  *Ip4Config2;
> +  EFI_IP4_CONFIG2_POLICYPolicy;
> 
>IpSb = IpInstance->Service;
> 
> +  Ip4Config2  = NULL;
> +
>//
>// User is changing packet filters. It must be stopped
>// before the station address can be changed.
>//
>if (IpInstance->State == IP4_STATE_CONFIGED) {
> @@ -675,14 +679,27 @@ Ip4ConfigProtocol (
>} else {
>  //
>  // Use the default address. Check the state.
>  //
>  if (IpSb->State == IP4_SERVICE_UNSTARTED) {
> -  Status = Ip4StartAutoConfig (>Ip4Config2Instance);
> -
> -  if (EFI_ERROR (Status)) {
> -goto ON_ERROR;
> +  //
> +  // Trigger the EFI_IP4_CONFIG2_PROTOCOL to retrieve the
> +  // default IPv4 address if it is not available yet.
> +  //
> +  Policy = IpSb->Ip4Config2Instance.Policy;
> +  if (Policy != Ip4Config2PolicyDhcp) {
> +Ip4Config2 = >Ip4Config2Instance.Ip4Config2;
> +Policy = Ip4Config2PolicyDhcp;
> +Status= Ip4Config2->SetData (
> +  Ip4Config2,
> +  Ip4Config2DataTypePolicy,
> +  sizeof (EFI_IP4_CONFIG2_POLICY),
> +  
> +  );
> +if (EFI_ERROR (Status)) {
> +  goto ON_ERROR;
> +}
>}
>  }
> 
>  IpIf = IpSb->DefaultInterface;
>  NET_GET_REF (IpSb->DefaultInterface);
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [RFC PATCH] ArmPkg: add driver to add distro installer HTTP boot options

2017-10-25 Thread Fu, Siyuan
Hi, Leif

We don't have plan to support redirection now, largely because we haven't 
receive any requirement for this feature before.


BestRegards
Fu Siyuan


> -Original Message-
> From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> Sent: Wednesday, October 25, 2017 4:38 PM
> To: Fu, Siyuan <siyuan...@intel.com>
> Cc: Laszlo Ersek <ler...@redhat.com>; edk2-devel@lists.01.org;
> daniel.thomp...@linaro.org; Ard Biesheuvel <ard.biesheu...@linaro.org>; Wu,
> Jiaxin <jiaxin...@intel.com>
> Subject: Re: [edk2] [RFC PATCH] ArmPkg: add driver to add distro installer
> HTTP boot options
> 
> On Wed, Oct 25, 2017 at 02:18:38AM +, Fu, Siyuan wrote:
> > Hi, Leif and Laszlo
> >
> > The HTTP restriction is actually not supported now. If server
> > replies a HTTP redirect response, the current HTTP boot driver will
> > only print new URL address on the screen then abort the HTTP
> > boot. It won't attempt to download the image from the new address.
> 
> Yes we noticed that :)
> The question was if that was an intentional restriction, or just
> something that has not been implemented yet.
> 
> Currently this is causing issues for example when attempting to
> download an image hosted in some sort of CDN.
> 
> Best Regards,
> 
> Leif
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] MdeModulePkg/SnpDxe: Check the value of Nii->Id before use it directly.

2017-12-20 Thread Fu, Siyuan
Hi, Jiaxin

In the line you are modifying the UDNI is always not started. You should move 
the Nii->Id to the line after PxeStart(), not to check it here.

BestRegards
Fu Siyuan

> -Original Message-
> From: Wu, Jiaxin
> Sent: Thursday, December 21, 2017 3:13 PM
> To: edk2-devel@lists.01.org
> Cc: Wang, Fan <fan.w...@intel.com>; Ye, Ting <ting...@intel.com>; Fu,
> Siyuan <siyuan...@intel.com>; Wu, Jiaxin <jiaxin...@intel.com>
> Subject: [Patch] MdeModulePkg/SnpDxe: Check the value of Nii->Id before
> use it directly.
> 
> Nii->Id is the address of the first byte of the identifying structure
> for this network interface. This is only valid when the network interface
> is started. When the network interface is not started, this field is set
> to zero. So, we should check the value of Nii->Id before use it directly.
> 
> Cc: Wang Fan <fan.w...@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
> ---
>  MdeModulePkg/Universal/Network/SnpDxe/Snp.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Snp.c
> b/MdeModulePkg/Universal/Network/SnpDxe/Snp.c
> index 9f61aee..f0257a2 100644
> --- a/MdeModulePkg/Universal/Network/SnpDxe/Snp.c
> +++ b/MdeModulePkg/Universal/Network/SnpDxe/Snp.c
> @@ -1,9 +1,9 @@
>  /** @file
>Implementation of driver entry point and driver binding protocol.
> 
> -Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
> +Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.
>  This program and the accompanying materials are licensed
>  and made available under the terms and conditions of the BSD License
> which
>  accompanies this distribution. The full text of the license may be found
> at
>  http://opensource.org/licenses/bsd-license.php
> 
> @@ -333,10 +333,15 @@ SimpleNetworkDriverStart (
>  return Status;
>}
> 
>DEBUG ((EFI_D_INFO, "Start(): UNDI3.1 found\n"));
> 
> +  if (Nii->Id == 0) {
> +DEBUG ((EFI_D_NET, "\nUNDI is not started.\n"));
> +goto NiiError;
> +  }
> +
>Pxe = (PXE_UNDI *) (UINTN) (Nii->Id);
> 
>if (Calc8BitCksum (Pxe, Pxe->hw.Len) != 0) {
>  DEBUG ((EFI_D_NET, "\n!PXE checksum is not correct.\n"));
>  goto NiiError;
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] NetworkPkg: Recycle the ICMP error message in PXE driver.

2017-12-20 Thread Fu Siyuan
This patch updates PxeBcIcmpErrorDpcHandle() and PxeBcIcmp6ErrorDpcHandle() to
recycle the ICMP packet after copy it to PXE mode data.

Cc: Ye Ting <ting...@intel.com>
Cc: Wu Jiaxin <jiaxin...@intel.com>
Cc: Wang Fan <fan.w...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan...@intel.com>
---
 NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c | 36 +++---
 1 file changed, 16 insertions(+), 20 deletions(-)

diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c 
b/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
index dfc79a067b..1e77929364 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
@@ -257,8 +257,7 @@ PxeBcIcmpErrorDpcHandle (
 //
 // The return status should be recognized as EFI_ICMP_ERROR.
 //
-gBS->SignalEvent (RxData->RecycleSignal);
-goto ON_EXIT;
+goto ON_RECYCLE;
   }
 
   if (EFI_IP4 (RxData->Header->SourceAddress) != 0 &&
@@ -268,24 +267,21 @@ PxeBcIcmpErrorDpcHandle (
 //
 // The source address of the received packet should be a valid unicast 
address.
 //
-gBS->SignalEvent (RxData->RecycleSignal);
-goto ON_EXIT;
+goto ON_RECYCLE;
   }
 
   if (!EFI_IP4_EQUAL (>Header->DestinationAddress, 
>StationIp.v4)) {
 //
 // The destination address of the received packet should be equal to the 
host address.
 //
-gBS->SignalEvent (RxData->RecycleSignal);
-goto ON_EXIT;
+goto ON_RECYCLE;
   }
 
   if (RxData->Header->Protocol != EFI_IP_PROTO_ICMP) {
 //
 // The protocol value in the header of the receveid packet should be 
EFI_IP_PROTO_ICMP.
 //
-gBS->SignalEvent (RxData->RecycleSignal);
-goto ON_EXIT;
+goto ON_RECYCLE;
   }
 
   Type = *((UINT8 *) RxData->FragmentTable[0].FragmentBuffer);
@@ -298,8 +294,7 @@ PxeBcIcmpErrorDpcHandle (
 //
 // The type of the receveid ICMP message should be ICMP_ERROR_MESSAGE.
 //
-gBS->SignalEvent (RxData->RecycleSignal);
-goto ON_EXIT;
+goto ON_RECYCLE;
   }
 
   //
@@ -326,6 +321,9 @@ PxeBcIcmpErrorDpcHandle (
 IcmpError += CopiedLen;
   }
 
+ON_RECYCLE:
+  gBS->SignalEvent (RxData->RecycleSignal);
+
 ON_EXIT:
   Private->IcmpToken.Status = EFI_NOT_READY;
   Ip4->Receive (Ip4, >IcmpToken);
@@ -395,16 +393,14 @@ PxeBcIcmp6ErrorDpcHandle (
 //
 // The return status should be recognized as EFI_ICMP_ERROR.
 //
-gBS->SignalEvent (RxData->RecycleSignal);
-goto ON_EXIT;
+goto ON_RECYCLE;
   }
 
   if (!NetIp6IsValidUnicast (>Header->SourceAddress)) {
 //
 // The source address of the received packet should be a valid unicast 
address.
 //
-gBS->SignalEvent (RxData->RecycleSignal);
-goto ON_EXIT;
+goto ON_RECYCLE;
   }
 
   if (!NetIp6IsUnspecifiedAddr (>StationIp.v6) &&
@@ -412,16 +408,14 @@ PxeBcIcmp6ErrorDpcHandle (
 //
 // The destination address of the received packet should be equal to the 
host address.
 //
-gBS->SignalEvent (RxData->RecycleSignal);
-goto ON_EXIT;
+goto ON_RECYCLE;
   }
 
   if (RxData->Header->NextHeader != IP6_ICMP) {
 //
 // The nextheader in the header of the receveid packet should be IP6_ICMP.
 //
-gBS->SignalEvent (RxData->RecycleSignal);
-goto ON_EXIT;
+goto ON_RECYCLE;
   }
 
   Type = *((UINT8 *) RxData->FragmentTable[0].FragmentBuffer);
@@ -433,8 +427,7 @@ PxeBcIcmp6ErrorDpcHandle (
 //
 // The type of the receveid packet should be an ICMP6 error message.
 //
-gBS->SignalEvent (RxData->RecycleSignal);
-goto ON_EXIT;
+goto ON_RECYCLE;
   }
 
   //
@@ -461,6 +454,9 @@ PxeBcIcmp6ErrorDpcHandle (
 Icmp6Error += CopiedLen;
   }
 
+ON_RECYCLE:
+  gBS->SignalEvent (RxData->RecycleSignal);
+  
 ON_EXIT:
   Private->Icmp6Token.Status = EFI_NOT_READY;
   Ip6->Receive (Ip6, >Icmp6Token);
-- 
2.13.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch V2] MdeModulePkg/IpIoLib: add more error handling code to DxeIpIoLib.

2017-12-21 Thread Fu Siyuan
V2 update:
Add missing "Status =" when call GetModeData()

In DxeIpIo, there are several places not check the returned value of called 
functions.
This patch is to add the error handling to these functions.

Cc: Ye Ting <ting...@intel.com>
Cc: Wu Jiaxin <jiaxin...@intel.com>
Cc: Wang Fan <fan.w...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan...@intel.com>
---
 MdeModulePkg/Include/Library/IpIoLib.h   |  4 +-
 MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c | 95 +---
 2 files changed, 60 insertions(+), 39 deletions(-)

diff --git a/MdeModulePkg/Include/Library/IpIoLib.h 
b/MdeModulePkg/Include/Library/IpIoLib.h
index aab0c68059..a8496f729d 100644
--- a/MdeModulePkg/Include/Library/IpIoLib.h
+++ b/MdeModulePkg/Include/Library/IpIoLib.h
@@ -2,7 +2,7 @@
   This library is only intended to be used by UEFI network stack modules.
   It provides the combined IpIo layer on the EFI IP4 Protocol and EFI IP6 
protocol.
 
-Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
 This program and the accompanying materials are licensed and made available 
under 
 the terms and conditions of the BSD License that accompanies this 
distribution.  
 The full text of the license may be found at
@@ -426,7 +426,7 @@ IpIoSend (
   IN IP_IO_IP_INFO  *SenderOPTIONAL,
   IN VOID   *Context   OPTIONAL,
   IN VOID   *NotifyDataOPTIONAL,
-  IN EFI_IP_ADDRESS *Dest,
+  IN EFI_IP_ADDRESS *Dest  OPTIONAL,
   IN IP_IO_OVERRIDE *OverrideData  OPTIONAL
   );
 
diff --git a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c 
b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
index abc07fb0ff..ae0199f58f 100644
--- a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
+++ b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
@@ -2,7 +2,7 @@
   IpIo Library.
 
 (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
-Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -234,24 +234,25 @@ IpIoCloseProtocolDestroyIpChild (
   //
   // Close the previously openned IP protocol.
   //
-  gBS->CloseProtocol (
- ChildHandle,
- IpProtocolGuid,
- ImageHandle,
- ControllerHandle
- );
+  Status = gBS->CloseProtocol (
+  ChildHandle,
+  IpProtocolGuid,
+  ImageHandle,
+  ControllerHandle
+  );
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
 
   //
   // Destroy the IP child.
   //
-  Status = NetLibDestroyServiceChild (
- ControllerHandle,
- ImageHandle,
- ServiceBindingGuid,
- ChildHandle
- );
-
-  return Status;
+  return NetLibDestroyServiceChild (
+   ControllerHandle,
+   ImageHandle,
+   ServiceBindingGuid,
+   ChildHandle
+   );
 }
 
 /**
@@ -377,8 +378,14 @@ IpIoIcmpv4Handler (
   TrimBytes  = (UINT32) (PayLoadHdr - (UINT8 *) IcmpHdr);
 
   NetbufTrim (Pkt, TrimBytes, TRUE);
-
-  IpIo->PktRcvdNotify (EFI_ICMP_ERROR, IcmpErr, Session, Pkt, 
IpIo->RcvdContext);
+  
+  //
+  // If the input packet has invalid format, and TrimBytes is larger than 
+  // the packet size, the NetbufTrim might trim the packet to zero.
+  //
+  if (Pkt->TotalSize != 0) {
+IpIo->PktRcvdNotify (EFI_ICMP_ERROR, IcmpErr, Session, Pkt, 
IpIo->RcvdContext);
+  }
 
   return EFI_SUCCESS;  
 }
@@ -539,7 +546,13 @@ IpIoIcmpv6Handler (
   
   NetbufTrim (Pkt, TrimBytes, TRUE);
 
-  IpIo->PktRcvdNotify (EFI_ICMP_ERROR, IcmpErr, Session, Pkt, 
IpIo->RcvdContext);
+  //
+  // If the input packet has invalid format, and TrimBytes is larger than 
+  // the packet size, the NetbufTrim might trim the packet to zero.
+  //
+  if (Pkt->TotalSize != 0) {
+IpIo->PktRcvdNotify (EFI_ICMP_ERROR, IcmpErr, Session, Pkt, 
IpIo->RcvdContext);
+  }
 
   return EFI_SUCCESS;
 }
@@ -1540,7 +1553,7 @@ IpIoSend (
   IN IP_IO_IP_INFO  *SenderOPTIONAL,
   IN VOID   *Context   OPTIONAL,
   IN VOID   *NotifyDataOPTIONAL,
-  IN EFI_IP_ADDRESS *Dest,
+  IN EFI_IP_ADDRESS *Dest  OPTIONAL,
   IN IP_IO_OVERRIDE *OverrideData  OPTIONAL
   )
 {
@@ -1791,19 +1804,23 @@ IpIoConfigIp (
   }
 
   if (IpConfigData != NULL) {
-if (IpInfo->IpVersion == IP_VERSION_4){
+if (IpInfo->IpVersion == IP_VERSION_4) {
 
   if (((EFI_IP4_CONFIG_DATA *) IpConfigData)->UseDefaultAddress) {
-Ip.Ip4->GetModeData (
-

Re: [edk2] [Patch] NetworkPkg/NetworkPkg.dsc: Add the instance of library class [SafeIntLib].

2018-05-07 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>

> -Original Message-
> From: Wu, Jiaxin
> Sent: Friday, May 4, 2018 11:53 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting...@intel.com>; Fu, Siyuan <siyuan...@intel.com>; Long,
> Qin <qin.l...@intel.com>; Bi, Dandan <dandan...@intel.com>; Wu, Jiaxin
> <jiaxin...@intel.com>
> Subject: [Patch] NetworkPkg/NetworkPkg.dsc: Add the instance of library
> class [SafeIntLib].
> 
> 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...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Cc: Long Qin <qin.l...@intel.com>
> Cc: Bi Dandan <dandan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
> ---
>  NetworkPkg/NetworkPkg.dsc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc
> index 471361ce86..dcca5f9fba 100644
> --- a/NetworkPkg/NetworkPkg.dsc
> +++ b/NetworkPkg/NetworkPkg.dsc
> @@ -43,10 +43,11 @@
> 
> TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.
> inf
> 
> PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNul
> l.inf
> 
> PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCof
> fGetEntryPointLib.inf
>DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
> 
> DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib
> .inf
> +  SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
> 
>DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
>NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
>IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
>UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
> --
> 2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] reg: EDK2 - HTTP Boot Image Validation

2018-05-22 Thread Fu, Siyuan
Hi, Siva

What do you mean by "skip the validation of image types"? Do you want to skip 
the "Content-type" HTTP header check, or name extension check, or both of them?


BestRegards
Fu Siyuan

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Sivaraman Nainar
> Sent: Friday, May 18, 2018 5:17 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] reg: EDK2 - HTTP Boot Image Validation
> 
> Hello all,
> When HTTP Boot performed the code checking if the Image type as EFI ISO
> and IMG. If not the boot not when the content type is as
> "Content-type: text/plain".
> https://github.com/tianocore/edk2/blob/master/NetworkPkg/HttpBootDxe/HttpB
> ootSupport.c (HttpBootCheckImageType())
> 
> But as per RFC it described below.
> https://tools.ietf.org/html/rfc2616#section-7.2.1:
> "If and only if the media type is not given by a Content-Type field, the
> recipient MAY attempt to guess the media type via inspection of its
> content and/or the name extension(s) of the URI used to identify the
> resource."
> Can you please comment if this need to be addressed such a way we can skip
> the validation of image types.
> -Siva
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] reg: EDK2 - HTTP Boot Image Validation

2018-05-23 Thread Fu, Siyuan
Using standardized HTTP header is high priority, you also mentioned that RFC 
says " If and only if the media type is not given by a Content-Type field..."

BestRegards
Fu Siyuan


> -Original Message-
> From: Sivaraman Nainar [mailto:sivaram...@amiindia.co.in]
> Sent: Wednesday, May 23, 2018 2:00 PM
> To: Fu, Siyuan <siyuan...@intel.com>; edk2-devel@lists.01.org
> Subject: RE: reg: EDK2 - HTTP Boot Image Validation
> 
> Hello Fu Siyuan,
> 
> We can skip the header check if we know the image type. That should be
> enough.
> 
> -Siva
> -Original Message-
> From: Fu, Siyuan [mailto:siyuan...@intel.com]
> Sent: Wednesday, May 23, 2018 11:14 AM
> To: Sivaraman Nainar; edk2-devel@lists.01.org
> Subject: RE: reg: EDK2 - HTTP Boot Image Validation
> 
> Hi, Siva
> 
> What do you mean by "skip the validation of image types"? Do you want to
> skip the "Content-type" HTTP header check, or name extension check, or
> both of them?
> 
> 
> BestRegards
> Fu Siyuan
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > Sivaraman Nainar
> > Sent: Friday, May 18, 2018 5:17 PM
> > To: edk2-devel@lists.01.org
> > Subject: [edk2] reg: EDK2 - HTTP Boot Image Validation
> >
> > Hello all,
> > When HTTP Boot performed the code checking if the Image type as EFI
> > ISO and IMG. If not the boot not when the content type is as
> > "Content-type: text/plain".
> > https://github.com/tianocore/edk2/blob/master/NetworkPkg/HttpBootDxe/H
> > ttpB ootSupport.c (HttpBootCheckImageType())
> >
> > But as per RFC it described below.
> > https://tools.ietf.org/html/rfc2616#section-7.2.1:
> > "If and only if the media type is not given by a Content-Type field,
> > the recipient MAY attempt to guess the media type via inspection of
> > its content and/or the name extension(s) of the URI used to identify
> > the resource."
> > Can you please comment if this need to be addressed such a way we can
> > skip the validation of image types.
> > -Siva
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] MdeModulePkg: Update IP4 driver to check for NULL pointer before using.

2018-06-26 Thread Fu Siyuan
Cc: Ye Ting 
Cc: Wu Jiaxin 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan 
---
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c 
b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
index 5a9d828703..6a26143e30 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
@@ -1048,11 +1048,8 @@ Ip4Groups (
   // is decreamented each time an address is removed..
   //
   for (Index = IpInstance->GroupCount; Index > 0 ; Index--) {
-Group = 0; 
-if(IpInstance->Groups != NULL) {
- Group = IpInstance->Groups[Index - 1];
-   }
-   
+ASSERT (IpInstance->Groups != NULL);
+Group = IpInstance->Groups[Index - 1];
 if ((GroupAddress == NULL) || EFI_IP4_EQUAL (, GroupAddress)) {
   if (EFI_ERROR (Ip4LeaveGroup (IpInstance, NTOHL (Group {
 return EFI_DEVICE_ERROR;
-- 
2.13.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] NetworkPkg/IScsiDxe: Clear the old IFR TargetIp to avoid sharing it with other attempts.

2017-10-26 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>

> -Original Message-
> From: Wu, Jiaxin
> Sent: Thursday, October 26, 2017 4:27 PM
> To: edk2-devel@lists.01.org
> Cc: Karunakar P <karunak...@amiindia.co.in>; Ye, Ting <ting...@intel.com>;
> Fu, Siyuan <siyuan...@intel.com>; Wu, Jiaxin <jiaxin...@intel.com>
> Subject: [Patch] NetworkPkg/IScsiDxe: Clear the old IFR TargetIp to avoid
> sharing it with other attempts.
> 
> Cc: Karunakar P <karunak...@amiindia.co.in>
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
> ---
>  NetworkPkg/IScsiDxe/IScsiConfig.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c
> b/NetworkPkg/IScsiDxe/IScsiConfig.c
> index 3ce37c5..3382982 100644
> --- a/NetworkPkg/IScsiDxe/IScsiConfig.c
> +++ b/NetworkPkg/IScsiDxe/IScsiConfig.c
> @@ -539,10 +539,11 @@ IScsiConvertAttemptConfigDataToIfrNvData (
>  IScsiIpToStr (, FALSE, IfrNvData->LocalIp);
>  CopyMem (, >SubnetMask, sizeof
> (EFI_IPv4_ADDRESS));
>  IScsiIpToStr (, FALSE, IfrNvData->SubnetMask);
>  CopyMem (, >Gateway, sizeof
> (EFI_IPv4_ADDRESS));
>  IScsiIpToStr (, FALSE, IfrNvData->Gateway);
> +ZeroMem (IfrNvData->TargetIp, sizeof (IfrNvData->TargetIp));
>  if (SessionConfigData->TargetIp.v4.Addr[0] != '\0') {
>CopyMem (, >TargetIp, sizeof
> (EFI_IPv4_ADDRESS));
>IScsiIpToStr (, FALSE, IfrNvData->TargetIp);
>  }
> 
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] MdeModulePkg/DpcLib: return error if failed to locate DPC protocol.

2017-12-21 Thread Fu Siyuan
This patch updates the constructor of DpcLib to return error if failed to
locate DPC protocol.

Cc: Ye Ting <ting...@intel.com>
Cc: Wu Jiaxin <jiaxin...@intel.com>
Cc: Wang Fan <fan.w...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan...@intel.com>
---
 MdeModulePkg/Library/DxeDpcLib/DpcLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/DxeDpcLib/DpcLib.c 
b/MdeModulePkg/Library/DxeDpcLib/DpcLib.c
index 6eda8ca0fb..ddc3e0adda 100644
--- a/MdeModulePkg/Library/DxeDpcLib/DpcLib.c
+++ b/MdeModulePkg/Library/DxeDpcLib/DpcLib.c
@@ -45,7 +45,7 @@ DpcLibConstructor (
   Status = gBS->LocateProtocol (, NULL, (VOID **));
   ASSERT_EFI_ERROR (Status);
 
-  return EFI_SUCCESS;
+  return Status;
 }
 
 /**
-- 
2.13.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 2/3] NetworkPkg/TcpDxe: Remove the redundant code.

2017-12-21 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>



> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jiaxin Wu
> Sent: Friday, December 22, 2017 3:07 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting...@intel.com>; Wang, Fan <fan.w...@intel.com>; Fu,
> Siyuan <siyuan...@intel.com>; Wu, Jiaxin <jiaxin...@intel.com>
> Subject: [edk2] [Patch 2/3] NetworkPkg/TcpDxe: Remove the redundant code.
> 
> The function SockGroup() is not used by any other code. So,
> it can be deleted.
> 
> Cc: Fu Siyuan <siyuan...@intel.com>
> Cc: Wang Fan <fan.w...@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
> ---
>  NetworkPkg/TcpDxe/SockInterface.c | 46 --
> -
>  NetworkPkg/TcpDxe/Socket.h| 21 +-
>  2 files changed, 1 insertion(+), 66 deletions(-)
> 
> diff --git a/NetworkPkg/TcpDxe/SockInterface.c
> b/NetworkPkg/TcpDxe/SockInterface.c
> index 0248cdf..0dfc0a7 100644
> --- a/NetworkPkg/TcpDxe/SockInterface.c
> +++ b/NetworkPkg/TcpDxe/SockInterface.c
> @@ -1078,56 +1078,10 @@ SockGetMode (
>  {
>return Sock->ProtoHandler (Sock, SOCK_MODE, Mode);
>  }
> 
>  /**
> -  Configure the low level protocol to join a multicast group for
> -  this socket's connection.
> -
> -  @param[in]  Sock Pointer to the socket of the connection to
> join the
> -   specific multicast group.
> -  @param[in]  GroupInfoPointer to the multicast group info.
> -
> -  @retval EFI_SUCCESS  The configuration completed successfully.
> -  @retval EFI_ACCESS_DENIEDFailed to get the lock to access the
> socket.
> -  @retval EFI_NOT_STARTED  The socket is not configured.
> -
> -**/
> -EFI_STATUS
> -SockGroup (
> -  IN SOCKET *Sock,
> -  IN VOID   *GroupInfo
> -  )
> -{
> -  EFI_STATUS  Status;
> -
> -  Status = EfiAcquireLockOrFail (&(Sock->Lock));
> -
> -  if (EFI_ERROR (Status)) {
> -
> -DEBUG (
> -  (EFI_D_ERROR,
> -  "SockGroup: Get the access for socket failed with %r",
> -  Status)
> -  );
> -
> -return EFI_ACCESS_DENIED;
> -  }
> -
> -  if (SOCK_IS_UNCONFIGURED (Sock)) {
> -Status = EFI_NOT_STARTED;
> -goto Exit;
> -  }
> -
> -  Status = Sock->ProtoHandler (Sock, SOCK_GROUP, GroupInfo);
> -
> -Exit:
> -  EfiReleaseLock (&(Sock->Lock));
> -  return Status;
> -}
> -
> -/**
>Add or remove route information in IP route table associated
>with this socket.
> 
>@param[in]  Sock Pointer to the socket associated with the
> IP route
> table to operate on.
> diff --git a/NetworkPkg/TcpDxe/Socket.h b/NetworkPkg/TcpDxe/Socket.h
> index f7f4a7a..26c5f4e 100644
> --- a/NetworkPkg/TcpDxe/Socket.h
> +++ b/NetworkPkg/TcpDxe/Socket.h
> @@ -1,9 +1,9 @@
>  /** @file
>Common head file for TCP socket.
> 
> -  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
> +  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
> 
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the
> BSD License
>which accompanies this distribution.  The full text of the license may
> be found at
>http://opensource.org/licenses/bsd-license.php.
> @@ -898,29 +898,10 @@ SockGetMode (
>IN SOCKET *Sock,
>IN OUT VOID   *Mode
>);
> 
>  /**
> -  Configure the low level protocol to join a multicast group for
> -  this socket's connection.
> -
> -  @param[in]  Sock Pointer to the socket of the connection to
> join the
> -   specific multicast group.
> -  @param[in]  GroupInfoPointer to the multicast group information.
> -
> -  @retval EFI_SUCCESS  The configuration completed successfully.
> -  @retval EFI_ACCESS_DENIEDFailed to get the lock to access the
> socket.
> -  @retval EFI_NOT_STARTED  The socket is not configured.
> -
> -**/
> -EFI_STATUS
> -SockGroup (
> -  IN SOCKET *Sock,
> -  IN VOID   *GroupInfo
> -  );
> -
> -/**
>Add or remove route information in IP route table associated
>with this socket.
> 
>@param[in]  Sock Pointer to the socket associated with the
> IP route
> table to operate on.
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 1/3] NetworkPkg/TcpDxe: Check FragmentBuffer for NULL before use

2017-12-21 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>

> -Original Message-
> From: Wu, Jiaxin
> Sent: Friday, December 22, 2017 3:07 PM
> To: edk2-devel@lists.01.org
> Cc: Fu, Siyuan <siyuan...@intel.com>; Wang, Fan <fan.w...@intel.com>; Ye,
> Ting <ting...@intel.com>; Wu, Jiaxin <jiaxin...@intel.com>
> Subject: [Patch 1/3] NetworkPkg/TcpDxe: Check FragmentBuffer for NULL
> before use
> 
> 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...@intel.com>
> Cc: Wang Fan <fan.w...@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
> ---
>  NetworkPkg/TcpDxe/TcpMain.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/NetworkPkg/TcpDxe/TcpMain.c b/NetworkPkg/TcpDxe/TcpMain.c
> index fc3713e..e349d2d 100644
> --- a/NetworkPkg/TcpDxe/TcpMain.c
> +++ b/NetworkPkg/TcpDxe/TcpMain.c
> @@ -38,10 +38,13 @@ TcpChkDataBuf (
>UINT32 Index;
> 
>UINT32 Len;
> 
>for (Index = 0, Len = 0; Index < FragmentCount; Index++) {
> +if (FragmentTable[Index].FragmentBuffer == NULL) {
> +  return EFI_INVALID_PARAMETER;
> +}
>  Len = Len + FragmentTable[Index].FragmentLength;
>}
> 
>if (DataLen != Len) {
>  return EFI_INVALID_PARAMETER;
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] NetworkPkg/HttpDxe: Fix build warning error if CHAR8 is unsigned.

2018-01-08 Thread Fu, Siyuan


Reviewed-by: Fu Siyuan <siyuan...@intel.com>

> -Original Message-
> From: Wu, Jiaxin
> Sent: Tuesday, January 2, 2018 11:34 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting...@intel.com>; Fu, Siyuan <siyuan...@intel.com>; Kinney,
> Michael D <michael.d.kin...@intel.com>; Wu, Jiaxin <jiaxin...@intel.com>
> Subject: [Patch] NetworkPkg/HttpDxe: Fix build warning error if CHAR8 is
> unsigned.
> 
> 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...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Cc: Michael Kinney <michael.d.kin...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
> ---
>  NetworkPkg/HttpDxe/HttpsSupport.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/NetworkPkg/HttpDxe/HttpsSupport.c
> b/NetworkPkg/HttpDxe/HttpsSupport.c
> index e6f4d5a..6aed61a 100644
> --- a/NetworkPkg/HttpDxe/HttpsSupport.c
> +++ b/NetworkPkg/HttpDxe/HttpsSupport.c
> @@ -65,15 +65,15 @@ AsciiStrCaseStr (
>  && (*String != '\0')) {
>Src = *String;
>Dst = *SearchStringTmp;
> 
>if ((Src >= 'A') && (Src <= 'Z')) {
> -Src -= ('A' - 'a');
> +Src += ('a' - 'A');
>}
> 
>if ((Dst >= 'A') && (Dst <= 'Z')) {
> -Dst -= ('A' - 'a');
> +Dst += ('a' - 'A');
>}
> 
>if (Src != Dst) {
>  break;
>}
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 0/2] IScsiDxe: Set ExitBootServiceEvent to NULL after close it.

2018-01-08 Thread Fu, Siyuan
Hi, Jiaxin,

The patch is good to me.

Reviewed-by: Fu Siyuan <siyuan...@intel.com>

> -Original Message-
> From: Wu, Jiaxin
> Sent: Tuesday, January 9, 2018 10:56 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting...@intel.com>; Fu, Siyuan <siyuan...@intel.com>; Wu,
> Jiaxin <jiaxin...@intel.com>
> Subject: [Patch 0/2] IScsiDxe: Set ExitBootServiceEvent to NULL after
> close it.
> 
> There are two place to close the ISCSI ExitBootServiceEvent:
> One is IScsiOnExitBootService callback function.
> Another is ISCSI driver stop() function.
> 
> When OS loader triggers ExitBootServiceEvent, firstly, the exit boot
> service
> callback function will close and free the ExitBootServiceEvent, then
> secondly
> the system will call ISCSI driver stop() function, the
> ExitBootServiceEvent
> will be closed and freed again, the use-after-free memory access happens.
> 
> This issue is recorded at
> https://bugzilla.tianocore.org/show_bug.cgi?id=742.
> This patch is to resolve the issue.
> 
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
> 
> *** BLURB HERE ***
> 
> Jiaxin Wu (2):
>   MdeModulePkg/IScsiDxe: Set ExitBootServiceEvent to NULL after close
> it.
>   NetworkPkg/IScsiDxe: Set ExitBootServiceEvent to NULL after close it.
> 
>  MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c | 12 
>  NetworkPkg/IScsiDxe/IScsiMisc.c | 12 
>  2 files changed, 16 insertions(+), 8 deletions(-)
> 
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 1/2] MdeModulePkg: Fixed two issues when error occurs in Mtftp4Start.

2018-01-08 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>

> -Original Message-
> From: Wang, Fan
> Sent: Tuesday, January 9, 2018 9:19 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Jiaxin <jiaxin...@intel.com>; Ye, Ting <ting...@intel.com>; Fu,
> Siyuan <siyuan...@intel.com>
> Subject: [Patch 1/2] MdeModulePkg: Fixed two issues when error occurs in
> Mtftp4Start.
> 
> * 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...@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wang Fan <fan.w...@intel.com>
> ---
>  .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 20 ---
> -
>  1 file changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> index 54384e1..f5f9e6d 100644
> --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> @@ -1,10 +1,10 @@
>  /** @file
>Interface routine for Mtftp4.
> 
>  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
> -Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
>  This program and the accompanying materials
>  are licensed and made available under the terms and conditions of the BSD
> License
>  which accompanies this distribution.  The full text of the license may be
> found at
>  http://opensource.org/licenses/bsd-license.php
> 
> @@ -407,31 +407,33 @@ Mtftp4Start (
>if (EFI_ERROR (Status)) {
>  gBS->RestoreTPL (OldTpl);
>  return Status;
>}
> 
> +  if ((Token->OverrideData != NULL) && !Mtftp4OverrideValid (Instance,
> Token->OverrideData)) {
> +Status = EFI_INVALID_PARAMETER;
> +gBS->RestoreTPL (OldTpl);
> +return Status;
> +  }
> +
>//
>// Set the Operation now to prevent the application start other
>// operations.
>//
>Instance->Operation = Operation;
>Override= Token->OverrideData;
> 
> -  if ((Override != NULL) && !Mtftp4OverrideValid (Instance, Override)) {
> -Status = EFI_INVALID_PARAMETER;
> -goto ON_ERROR;
> -  }
> -
>if (Token->OptionCount != 0) {
>  Status = Mtftp4ParseOption (
> Token->OptionList,
> Token->OptionCount,
> TRUE,
> >RequestOption
> );
> 
>  if (EFI_ERROR (Status)) {
> +  Status = EFI_DEVICE_ERROR;
>goto ON_ERROR;
>  }
>}
> 
>//
> @@ -482,10 +484,11 @@ Mtftp4Start (
>// Config the unicast UDP child to send initial request
>//
>Status = Mtftp4ConfigUnicastPort (Instance->UnicastPort, Instance);
> 
>if (EFI_ERROR (Status)) {
> +Status = EFI_DEVICE_ERROR;
>  goto ON_ERROR;
>}
> 
>//
>// Set initial status.
> @@ -499,17 +502,17 @@ Mtftp4Start (
>  Status = Mtftp4WrqStart (Instance, Operation);
>} else {
>  Status = Mtftp4RrqStart (Instance, Operation);
>}
> 
> -  gBS->RestoreTPL (OldTpl);
> -
>if (EFI_ERROR (Status)) {
> +Status = EFI_DEVICE_ERROR;
>  goto ON_ERROR;
>}
> 
>if (Token->Event != NULL) {
> +gBS->RestoreTPL (OldTpl);
>  return EFI_SUCCESS;
>}
> 
>//
>// Return immediately for asynchronous operation or poll the
> @@ -517,10 +520,11 @@ Mtftp4Start (
>//
>while (Token->Status == EFI_NOT_READY) {
>  This->Poll (This);
>}
> 
> +  gBS->RestoreTPL (OldTpl);
>return Token->Status;
> 
>  ON_ERROR:
>Mtftp4CleanOperation (Instance, Status);
>gBS->RestoreTPL (OldTpl);
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] NetworkPkg: Fix incorrect parameter check in PXE.Mtftp() function.

2018-01-11 Thread Fu Siyuan
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.

Cc: Ye Ting <ting...@intel.com>
Cc: Wu Jiaxin <jiaxin...@intel.com>
Cc: Wang Fan <fan.w...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan...@intel.com>
---
 NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c 
b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
index 93f3bfa5ba..9068e0686c 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
@@ -855,11 +855,19 @@ EfiPxeBcMtftp (
   (Filename == NULL) ||
   (BufferSize == NULL) ||
   (ServerIp == NULL) ||
-  ((BufferPtr == NULL) && DontUseBuffer) ||
   ((BlockSize != NULL) && (*BlockSize < PXE_MTFTP_DEFAULT_BLOCK_SIZE))) {
 return EFI_INVALID_PARAMETER;
   }
 
+  if (Operation == EFI_PXE_BASE_CODE_TFTP_READ_FILE ||
+  Operation == EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY ||
+  Operation == EFI_PXE_BASE_CODE_MTFTP_READ_FILE ||
+  Operation == EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY) {
+if (BufferPtr == NULL && !DontUseBuffer) {
+  return EFI_INVALID_PARAMETER;
+}
+  }
+
   Config= NULL;
   Status= EFI_DEVICE_ERROR;
   Private   = PXEBC_PRIVATE_DATA_FROM_PXEBC (This);
-- 
2.13.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 2/2] MdeModulePkg: Freed packet buffer when error occurs to avoid memory leak.

2018-01-08 Thread Fu, Siyuan


Reviewed-by: Fu Siyuan <siyuan...@intel.com>



> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Wang Fan
> Sent: Tuesday, January 9, 2018 9:19 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting...@intel.com>; Fu, Siyuan <siyuan...@intel.com>; Wu,
> Jiaxin <jiaxin...@intel.com>
> Subject: [edk2] [Patch 2/2] MdeModulePkg: Freed packet buffer when error
> occurs to avoid memory leak.
> 
> * 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...@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wang Fan <fan.w...@intel.com>
> ---
>  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c
> b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c
> index e825714..438659a 100644
> --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c
> +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c
> @@ -1,9 +1,9 @@
>  /** @file
>Routines to process Wrq (upload).
> 
> -Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
>  This program and the accompanying materials
>  are licensed and made available under the terms and conditions of the BSD
> License
>  which accompanies this distribution.  The full text of the license may be
> found at
>  http://opensource.org/licenses/bsd-license.php
> 
> @@ -92,10 +92,14 @@ Mtftp4WrqSendBlock (
>  if (EFI_ERROR (Status) || (DataLen > Instance->BlkSize)) {
>if (DataBuf != NULL) {
>  FreePool (DataBuf);
>}
> 
> +  if (UdpPacket != NULL) {
> +NetbufFree (UdpPacket);
> +  }
> +
>Mtftp4SendError (
>  Instance,
>  EFI_MTFTP4_ERRORCODE_REQUEST_DENIED,
>  (UINT8 *) "User aborted the transfer"
>  );
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] Potential incompatible bug fix for PXE boot

2018-01-16 Thread Fu, Siyuan
Hi, All (especially OS PXE loader developers)

I'm sending this email to collect advice about whether to include the bug fix 
for Bugzilla 853 (https://bugzilla.tianocore.org/show_bug.cgi?id=853) to 
UDK2018 or not.

The patch is to fix an input parameter check for PXE.Mtftp() protocol 
interface. If any OS PXE loader follows the incorrect logic in previous edk2 
code, instead of the UEFI specification required logic, to use PXE.MTFTP() 
protocol, the PXE boot may be broken. Please check the Bugzilla for details.

We have validated the patch on some popular Windows/Linux Oss and it worked 
well.

Please tell me if you meet problem with this patch on your system, or have any 
objection to include this patch to UDK2018.


BestRegards
Fu Siyuan

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 2/2] MdeModulePkg: Did some code enhancement for DxeIpIpLib.

2018-01-14 Thread Fu, Siyuan

Reviewed-by: Fu Siyuan <siyuan...@intel.com>



> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Wang Fan
> Sent: Wednesday, January 10, 2018 11:16 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting...@intel.com>; Fu, Siyuan <siyuan...@intel.com>; Wu,
> Jiaxin <jiaxin...@intel.com>
> Subject: [edk2] [Patch 2/2] MdeModulePkg: Did some code enhancement for
> DxeIpIpLib.
> 
> * In DxeIpIo, there are several places use ASSERT() to check input
>   parameters without and descriptions or error handling. This patch
>   fixed this issue.
> * Fixed some incorrect descriptions in code commence.
> * Remove unneeded Exit tag in function IpIoOpen and IpIoConfigIp.
> * Add EFIAPI tag for function IpIoRefreshNeighbor.
> 
> Cc: Jiaxin Wu <jiaxin...@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wang Fan <fan.w...@intel.com>
> ---
>  MdeModulePkg/Include/Library/IpIoLib.h   | 21 +--
>  MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c | 52 ++-
> -
>  2 files changed, 52 insertions(+), 21 deletions(-)
> 
> diff --git a/MdeModulePkg/Include/Library/IpIoLib.h
> b/MdeModulePkg/Include/Library/IpIoLib.h
> index 463bf95..61653b0 100644
> --- a/MdeModulePkg/Include/Library/IpIoLib.h
> +++ b/MdeModulePkg/Include/Library/IpIoLib.h
> @@ -308,10 +308,12 @@ typedef struct _IP_IO_IP_INFO {
>UINT8 IpVersion;
>  } IP_IO_IP_INFO;
> 
>  /**
>Create a new IP_IO instance.
> +
> +  If IpVersion is not IP_VERSION_4 or IP_VERSION_6, then ASSERT().
> 
>This function uses IP4/IP6 service binding protocol in Controller to
> create
>an IP4/IP6 child (aka IP4/IP6 instance).
> 
>@param[in]  Image The image handle of the driver or
> application that
> @@ -351,10 +353,12 @@ IpIoDestroy (
>IN OUT IP_IO *IpIo
>);
> 
>  /**
>Stop an IP_IO instance.
> +
> +  If Ip version is not IP_VERSION_4 or IP_VERSION_6, then ASSERT().
> 
>This function is paired with IpIoOpen(). The IP_IO will be unconfigured,
> and all
>pending send/receive tokens will be canceled.
> 
>@param[in, out]  IpIoThe pointer to the IP_IO instance that
> needs to stop.
> @@ -370,11 +374,13 @@ IpIoStop (
>IN OUT IP_IO *IpIo
>);
> 
>  /**
>Open an IP_IO instance for use.
> -
> +
> +  If Ip version is not IP_VERSION_4 or IP_VERSION_6, then ASSERT().
> +
>This function is called after IpIoCreate(). It is used for configuring
> the IP
>instance and register the callbacks and their context data for sending
> and
>receiving IP packets.
> 
>@param[in, out]  IpIo   The pointer to an IP_IO instance
> that needs
> @@ -399,11 +405,11 @@ IpIoOpen (
>);
> 
>  /**
>Send out an IP packet.
> 
> -  This function is called after IpIoOpen(). The data to be sent are
> wrapped in
> +  This function is called after IpIoOpen(). The data to be sent is
> wrapped in
>Pkt. The IP instance wrapped in IpIo is used for sending by default but
> can be
>overriden by Sender. Other sending configs, like source address and
> gateway
>address etc., are specified in OverrideData.
> 
>@param[in, out]  IpIo  Pointer to an IP_IO instance
> used for sending IP
> @@ -437,10 +443,13 @@ IpIoSend (
>);
> 
>  /**
>Cancel the IP transmit token that wraps this Packet.
> 
> +  If IpIo is NULL, then ASSERT().
> +  If Packet is NULL, then ASSERT().
> +
>@param[in]  IpIo  The pointer to the IP_IO instance.
>@param[in]  PacketThe pointer to the packet of NET_BUF
> to cancel.
> 
>  **/
>  VOID
> @@ -450,10 +459,13 @@ IpIoCancelTxToken (
>IN VOID   *Packet
>);
> 
>  /**
>Add a new IP instance for sending data.
> +
> +  If IpIo is NULL, then ASSERT().
> +  If Ip version is not IP_VERSION_4 or IP_VERSION_6, then ASSERT().
> 
>The function is used to add the IP_IO to the IP_IO sending list. The
> caller
>can later use IpIoFindSender() to get the IP_IO and call IpIoSend() to
> send
>data.
> 
> @@ -471,10 +483,12 @@ IpIoAddIp (
> 
>  /**
>Configure the IP instance of this IpInfo and start the receiving if
> IpConfigData
>is not NULL.
> 
> +  If Ip version is not IP_VERSION_4 or IP_VERSION_6, then ASSERT().
> +
>@param[in, out]  IpInfo  The pointer to the IP_IO_IP_INFO
> instance.
>@param[in, out]  IpConfigDataThe IP4 or IP6 

Re: [edk2] [Patch 1/2] MdeModulePkg: Freed the received packet buffer if it is not expected.

2018-01-14 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>

> -Original Message-
> From: Wang, Fan
> Sent: Wednesday, January 10, 2018 11:16 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Jiaxin <jiaxin...@intel.com>; Ye, Ting <ting...@intel.com>; Fu,
> Siyuan <siyuan...@intel.com>
> Subject: [Patch 1/2] MdeModulePkg: Freed the received packet buffer if it
> is not expected.
> 
> * When the packet is not normal packet or icmp error packet, the code
>   does not recycle it by signal RecycleSignal event, and this will
>   result some memory leak. This patch is to fix this issue.
> 
> Cc: Jiaxin Wu <jiaxin...@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wang Fan <fan.w...@intel.com>
> ---
>  MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c | 18 ++
>  1 file changed, 14 insertions(+), 4 deletions(-)
> 
> diff --git a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
> b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
> index a06c0b6..c7bc1aa 100644
> --- a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
> +++ b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
> @@ -1037,16 +1037,26 @@ IpIoListenHandlerDpc (
>  // The reception is actively aborted by the consumer, directly return.
>  //
>  return;
>}
> 
> -  if (((EFI_SUCCESS != Status) && (EFI_ICMP_ERROR != Status)) || (NULL ==
> RxData)) {
> +  if ((EFI_SUCCESS != Status) && (EFI_ICMP_ERROR != Status)) {
>  //
> -// @bug Only process the normal packets and the icmp error packets,
> if RxData is NULL
> -// @bug with Status == EFI_SUCCESS or EFI_ICMP_ERROR, just resume the
> receive although
> -// @bug this should be a bug of the low layer (IP).
> +// Only process the normal packets and the icmp error packets.
>  //
> +if (RxData != NULL) {
> +  goto CleanUp;
> +} else {
> +  goto Resume;
> +}
> +  }
> +
> +  //
> +  // if RxData is NULL with Status == EFI_SUCCESS or EFI_ICMP_ERROR, this
> should be a code issue in the low layer (IP).
> +  //
> +  ASSERT (RxData != NULL);
> +  if (RxData == NULL) {
>  goto Resume;
>}
> 
>if (NULL == IpIo->PktRcvdNotify) {
>  goto CleanUp;
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch v2] MdeModulePkg/DxeNetLib: Add array range check in NetIp6IsNetEqual().

2018-01-11 Thread Fu, Siyuan


Reviewed-by: Fu Siyuan <siyuan...@intel.com>



> -Original Message-
> From: Wang, Fan
> Sent: Thursday, January 11, 2018 6:14 PM
> To: edk2-devel@lists.01.org
> Cc: Fu, Siyuan <siyuan...@intel.com>; Wu, Jiaxin <jiaxin...@intel.com>; Wu,
> Hao A <hao.a...@intel.com>
> Subject: [Patch v2] MdeModulePkg/DxeNetLib: Add array range check in
> NetIp6IsNetEqual().
> 
> V2
> * Added an ASSERT check for the case PrefixLength equals to IP6_PREFIX_MAX.
> * Synced some code descriptions to head file.
> 
> Cc: Fu Siyuan <siyuan...@intel.com>
> Cc: Jiaxin Wu <jiaxin...@intel.com>
> Cc: Hao Wu <hao.a...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wang Fan <fan.w...@intel.com>
> ---
>  MdeModulePkg/Include/Library/NetLib.h  | 50
> +++---
>  MdeModulePkg/Library/DxeNetLib/DxeNetLib.c |  8 +++--
>  2 files changed, 52 insertions(+), 6 deletions(-)
> 
> diff --git a/MdeModulePkg/Include/Library/NetLib.h
> b/MdeModulePkg/Include/Library/NetLib.h
> index 7862df9..b0bbaf2 100644
> --- a/MdeModulePkg/Include/Library/NetLib.h
> +++ b/MdeModulePkg/Include/Library/NetLib.h
> @@ -1,10 +1,10 @@
>  /** @file
>This library is only intended to be used by UEFI network stack modules.
>It provides basic functions for the UEFI network stack.
> 
> -Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
> +Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
>  This program and the accompanying materials
>  are licensed and made available under the terms and conditions of the BSD
> License
>  which accompanies this distribution.  The full text of the license may be
> found at
>  http://opensource.org/licenses/bsd-license.php
> 
> @@ -438,10 +438,12 @@ NetIp4IsUnicast (
>);
> 
>  /**
>Check whether the incoming IPv6 address is a valid unicast address.
> 
> +  ASSERT if Ip6 is NULL.
> +
>If the address is a multicast address has binary 0xFF at the start, it
> is not
>a valid unicast address. If the address is unspecified ::, it is not a
> valid
>unicast address to be assigned to any node. If the address is loopback
> address
>::1, it is also not a valid unicast address to be assigned to any
> physical
>interface.
> @@ -459,10 +461,12 @@ NetIp6IsValidUnicast (
> 
> 
>  /**
>Check whether the incoming Ipv6 address is the unspecified address or
> not.
> 
> +  ASSERT if Ip6 is NULL.
> +
>@param[in] Ip6   - Ip6 address, in network order.
> 
>@retval TRUE - Yes, incoming Ipv6 address is the unspecified
> address.
>@retval FALSE- The incoming Ipv6 address is not the unspecified
> address
> 
> @@ -474,10 +478,12 @@ NetIp6IsUnspecifiedAddr (
>);
> 
>  /**
>Check whether the incoming Ipv6 address is a link-local address.
> 
> +  ASSERT if Ip6 is NULL.
> +
>@param[in] Ip6   - Ip6 address, in network order.
> 
>@retval TRUE  - The incoming Ipv6 address is a link-local address.
>@retval FALSE - The incoming Ipv6 address is not a link-local address.
> 
> @@ -489,10 +495,13 @@ NetIp6IsLinkLocalAddr (
>);
> 
>  /**
>Check whether the Ipv6 address1 and address2 are on the connected
> network.
> 
> +  ASSERT if Ip1 or Ip2 is NULL.
> +  ASSERT if PrefixLength exceeds or equals to IP6_PREFIX_MAX.
> +
>@param[in] Ip1  - Ip6 address1, in network order.
>@param[in] Ip2  - Ip6 address2, in network order.
>@param[in] PrefixLength - The prefix length of the checking net.
> 
>@retval TRUE- Yes, the Ipv6 address1 and address2 are
> connected.
> @@ -508,10 +517,12 @@ NetIp6IsNetEqual (
>);
> 
>  /**
>Switches the endianess of an IPv6 address.
> 
> +  ASSERT if Ip6 is NULL.
> +
>This function swaps the bytes in a 128-bit IPv6 address to switch the
> value
>from little endian to big endian or vice versa. The byte swapped value
> is
>returned.
> 
>@param  Ip6 Points to an IPv6 address.
> @@ -542,10 +553,12 @@ extern EFI_IPv4_ADDRESS  mZeroIp4Addr;
>  #define NET_RANDOM(Seed)((UINT32) ((UINT32) (Seed) * 1103515245UL
> + 12345) % 4294967295UL)
> 
>  /**
>Extract a UINT32 from a byte stream.
> 
> +  ASSERT if Buf is NULL.
> +
>This function copies a UINT32 from a byte stream, and then converts it
> from Network
>byte order to host byte order. Use this function to avoid alignment
> error.
> 
>@param[in]  Buf The buffer to extract the UINT32.
> 
> @@ -559,10 +572,12 @@ NetGetUint32 (
>);
> 
>  /**
>Puts a UINT32 

Re: [edk2] [Patch] MdeModulePkg/Ip4Dxe: Add an independent timer for reconfig checking

2018-01-11 Thread Fu, Siyuan


Reviewed-by: Fu Siyuan <siyuan...@intel.com>

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Wang Fan
> Sent: Thursday, January 11, 2018 6:20 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting...@intel.com>; Fu, Siyuan <siyuan...@intel.com>; Wu,
> Jiaxin <jiaxin...@intel.com>
> Subject: [edk2] [Patch] MdeModulePkg/Ip4Dxe: Add an independent timer for
> reconfig checking
> 
> * 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...@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wang Fan <fan.w...@intel.com>
> ---
>  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c | 28 +-
>  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c   | 47 +++---
> -
>  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h   | 30 ---
>  3 files changed, 83 insertions(+), 22 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c
> b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c
> index 49b7dc5..552c4e1 100644
> --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c
> +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c
> @@ -1,9 +1,9 @@
>  /** @file
>The driver binding and service binding protocol for IP4 driver.
> 
> -Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
> +Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
>  (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
> 
>  This program and the accompanying materials
>  are licensed and made available under the terms and conditions of the BSD
> License
>  which accompanies this distribution.  The full text of the license may be
> found at
> @@ -251,10 +251,11 @@ Ip4CreateService (
>IpSb->MnpConfigData.DisableBackgroundPolling  = FALSE;
> 
>ZeroMem (>SnpMode, sizeof (EFI_SIMPLE_NETWORK_MODE));
> 
>IpSb->Timer = NULL;
> +  IpSb->ReconfigCheckTimer = NULL;
> 
>IpSb->ReconfigEvent = NULL;
> 
>IpSb->Reconfig = FALSE;
> 
> @@ -283,10 +284,22 @@ Ip4CreateService (
>if (EFI_ERROR (Status)) {
>  goto ON_ERROR;
>}
> 
>Status = gBS->CreateEvent (
> +  EVT_NOTIFY_SIGNAL | EVT_TIMER,
> +  TPL_CALLBACK,
> +  Ip4TimerReconfigChecking,
> +  IpSb,
> +  >ReconfigCheckTimer
> +  );
> +
> +  if (EFI_ERROR (Status)) {
> +goto ON_ERROR;
> +  }
> +
> +  Status = gBS->CreateEvent (
>EVT_NOTIFY_SIGNAL,
>TPL_NOTIFY,
>Ip4AutoReconfigCallBack,
>IpSb,
>>ReconfigEvent
> @@ -408,10 +421,17 @@ Ip4CleanService (
>  gBS->CloseEvent (IpSb->Timer);
> 
>  IpSb->Timer = NULL;
>}
> 
> +  if (IpSb->ReconfigCheckTimer != NULL) {
> +gBS->SetTimer (IpSb->ReconfigCheckTimer, TimerCancel, 0);
> +gBS->CloseEvent (IpSb->ReconfigCheckTimer);
> +
> +IpSb->ReconfigCheckTimer = NULL;
> +  }
> +
>if (IpSb->DefaultInterface != NULL) {
>  Status = Ip4FreeInterface (IpSb->DefaultInterface, NULL);
> 
>  if (EFI_ERROR (Status)) {
>return Status;
> @@ -628,10 +648,16 @@ Ip4DriverBindingStart (
> 
>if (EFI_ERROR (Status)) {
>  goto UNINSTALL_PROTOCOL;
>}
> 
> +  Status = gBS->SetTimer (IpSb->ReconfigCheckTimer, TimerPeriodic, 500 *
> TICKS_PER_MS);
> +
> +  if (EFI_ERROR (Status)) {
> +goto UNINSTALL_PROTOCOL;
> +  }
> +
>//
>// Initialize the IP4 ID
>//
>mIp4Id = (UINT16)NET_RANDOM (NetRandomInitSeed ());
> 
> diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
> b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
> index ac48ad2..b5cd7b7 100644
> --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
> +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
> @@ -1,8 +1,8 @@
>  /** @file
> 
> -Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
> +Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
>  This program and the accompanying materials
>  are licensed and made available under the terms and conditions of the BSD
> License
>  which accompanies this distribution.  The full text of the license may be
> fo

[edk2] [Patch 2/2] MdeModulePkg/PXE: Add warning message for PXE if failed to read system GUID from SMBIOS.

2018-02-01 Thread Fu Siyuan
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.

Cc: Ye Ting <ting...@intel.com>
Cc: Wu Jiaxin <jiaxin...@intel.com>
Cc: Wang Fan <fan.w...@intel.com>
Cc: Yao Jiewen <jiewen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan...@intel.com>
---
 MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c 
b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
index c5f343788b..e48b54c876 100644
--- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
+++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
@@ -2,7 +2,7 @@
   Support for PxeBc dhcp functions.
 
 Copyright (c) 2013, Red Hat, Inc.
-Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -957,6 +957,7 @@ PxeBcDhcpCallBack (
 // SetMem(DHCPV4_OPTIONS_BUFFER.DhcpPlatformId.Guid, sizeof(EFI_GUID), 
0xff);
 // GUID not yet set - send all 0's to show not programable
 //
+DEBUG ((EFI_D_WARN, "PXE: Failed to read system GUID from the smbios 
table!\n"));
 ZeroMem (DhcpHeader->ClientHwAddr, sizeof (EFI_GUID));
   }
 
@@ -1133,6 +1134,7 @@ PxeBcBuildDhcpOptions (
 // SetMem(DHCPV4_OPTIONS_BUFFER.DhcpPlatformId.Guid, sizeof(EFI_GUID), 
0xff);
 // GUID not yet set - send all 0's to show not programable
 //
+DEBUG ((EFI_D_WARN, "PXE: Failed to read system GUID from the smbios 
table!\n"));
 ZeroMem (OptEnt.Uuid->Guid, sizeof (EFI_GUID));
   }
 
@@ -1301,6 +1303,7 @@ PxeBcDiscvBootService (
   //
   // GUID not yet set - send all 0's to show not programable
   //
+  DEBUG ((EFI_D_WARN, "PXE: Failed to read system GUID from the smbios 
table!\n"));
   ZeroMem (DhcpHeader->ClientHwAddr, sizeof (EFI_GUID));
 }
 
-- 
2.13.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch 0/2] NetworkPkg: Add warning message for PXE if failed to read system GUID from SMBIOS.

2018-02-01 Thread Fu Siyuan
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.

Fu Siyuan (2):
  NetworkPkg: Add warning message for PXE if failed to read system GUID
from SMBIOS.
  MdeModulePkg/PXE: Add warning message for PXE if failed to read system
GUID from SMBIOS.

 MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c | 5 -
 NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c| 3 +++
 NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c | 1 +
 3 files changed, 8 insertions(+), 1 deletion(-)

-- 
2.13.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch 1/2] NetworkPkg: Add warning message for PXE if failed to read system GUID from SMBIOS.

2018-02-01 Thread Fu Siyuan
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.

Cc: Ye Ting <ting...@intel.com>
Cc: Wu Jiaxin <jiaxin...@intel.com>
Cc: Wang Fan <fan.w...@intel.com>
Cc: Yao Jiewen <jiewen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan...@intel.com>
---
 NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c | 3 +++
 NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c  | 1 +
 2 files changed, 4 insertions(+)

diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c 
b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
index b2c03eb269..bb65445fc9 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
@@ -320,6 +320,7 @@ PxeBcBuildDhcp4Options (
 //
 // Zero the Guid to indicate NOT programable if failed to get system Guid.
 //
+DEBUG ((EFI_D_WARN, "PXE: Failed to read system GUID from the smbios 
table!\n"));
 ZeroMem (OptEnt.Uuid->Guid, sizeof (EFI_GUID));
   }
 
@@ -1282,6 +1283,7 @@ PxeBcDhcp4CallBack (
 //
 // Zero the Guid to indicate NOT programable if failed to get system 
Guid.
 //
+DEBUG ((EFI_D_WARN, "PXE: Failed to read system GUID from the smbios 
table!\n"));
 ZeroMem (Packet->Dhcp4.Header.ClientHwAddr, sizeof (EFI_GUID));
   }
   Packet->Dhcp4.Header.HwAddrLen = (UINT8) sizeof (EFI_GUID);
@@ -1470,6 +1472,7 @@ PxeBcDhcp4Discover (
   //
   // Zero the Guid to indicate NOT programable if failed to get system 
Guid.
   //
+  DEBUG ((EFI_D_WARN, "PXE: Failed to read system GUID from the smbios 
table!\n"));
   ZeroMem (Token.Packet->Dhcp4.Header.ClientHwAddr, sizeof (EFI_GUID));
 }
 Token.Packet->Dhcp4.Header.HwAddrLen = (UINT8)  sizeof (EFI_GUID);
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c 
b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
index 9068e0686c..d3146c3a7e 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
@@ -1949,6 +1949,7 @@ EfiPxeBcSetParameters (
 
   if (NewSendGUID != NULL) {
 if (*NewSendGUID && EFI_ERROR (NetLibGetSystemGuid ())) {
+  DEBUG ((EFI_D_WARN, "PXE: Failed to read system GUID from the smbios 
table!\n"));
   return EFI_INVALID_PARAMETER;
 }
 Mode->SendGUID = *NewSendGUID;
-- 
2.13.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 0/2] NetworkPkg: Add warning message for PXE if failed to read system GUID from SMBIOS.

2018-02-01 Thread Fu, Siyuan
Jiewen,

NetLibGetSystemGuid is also used by some other drivers like DHCP6, and it's 
acceptable to not use system GUID as client identifier in DHCP protocol. That's 
why I only add the warning in PXE driver.

BestRegards
Fu Siyuan

> -Original Message-
> From: Yao, Jiewen
> Sent: Friday, February 2, 2018 11:47 AM
> To: Fu, Siyuan <siyuan...@intel.com>; edk2-devel@lists.01.org
> Subject: RE: [edk2] [Patch 0/2] NetworkPkg: Add warning message for PXE if
> failed to read system GUID from SMBIOS.
> 
> Hi Siyuan
> It is great idea to add such warning message to help debug such PXE issue.
> 
> Do you think it will be better if we add such info in NetLib -
> NetLibGetSystemGuid().
> 
> As such, we don't need update all consumers.
> 
> Thank you
> Yao Jiewen
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Fu
> > Siyuan
> > Sent: Friday, February 2, 2018 11:29 AM
> > To: edk2-devel@lists.01.org
> > Subject: [edk2] [Patch 0/2] NetworkPkg: Add warning message for PXE if
> failed
> > to read system GUID 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.
> >
> > Fu Siyuan (2):
> >   NetworkPkg: Add warning message for PXE if failed to read system GUID
> > from SMBIOS.
> >   MdeModulePkg/PXE: Add warning message for PXE if failed to read system
> > GUID from SMBIOS.
> >
> >  MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c | 5 -
> >  NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c| 3 +++
> >  NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c | 1 +
> >  3 files changed, 8 insertions(+), 1 deletion(-)
> >
> > --
> > 2.13.0.windows.1
> >
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 0/2] NetworkPkg: Support the platform to configure TLS CipherList.

2018-02-08 Thread Fu, Siyuan
Hi, Jiaxin

I think we can remove the "TlsCipherList.h" to another name like 
"HttpTlsCipherListVariable.h" to  highlight that the variable is only used for 
HTTP configuration. And also the variable name and GUID name. 

Siyuan

> -Original Message-
> From: Wu, Jiaxin
> Sent: Friday, February 9, 2018 12:00 PM
> To: edk2-devel@lists.01.org
> Cc: Laszlo Ersek <ler...@redhat.com>; Kinney, Michael D
> <michael.d.kin...@intel.com>; Zimmer, Vincent <vincent.zim...@intel.com>;
> Yao, Jiewen <jiewen@intel.com>; Ye, Ting <ting...@intel.com>; Fu,
> Siyuan <siyuan...@intel.com>; Wu, Jiaxin <jiaxin...@intel.com>
> Subject: [Patch 0/2] NetworkPkg: Support the platform to configure TLS
> CipherList.
> 
> Cc: Laszlo Ersek <ler...@redhat.com>
> Cc: Kinney Michael D <michael.d.kin...@intel.com>
> Cc: Zimmer Vincent <vincent.zim...@intel.com>
> Cc: Yao Jiewen <jiewen@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
> 
> Jiaxin Wu (2):
>   NetworkPkg: Define one private variable for TLS CipherList
> configuration.
>   NetworkPkg: Read TlsCipherList variable and configure it for HTTPS
> session.
> 
>  NetworkPkg/HttpDxe/HttpDriver.h |  3 +-
>  NetworkPkg/HttpDxe/HttpDxe.inf  |  3 +-
>  NetworkPkg/HttpDxe/HttpsSupport.c   | 92
> -
>  NetworkPkg/Include/Guid/TlsCipherList.h | 38 ++
>  NetworkPkg/NetworkPkg.dec   |  3 ++
>  5 files changed, 136 insertions(+), 3 deletions(-)
>  create mode 100644 NetworkPkg/Include/Guid/TlsCipherList.h
> 
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 0/2] NetworkPkg: Support the platform to configure HTTPS CipherList.

2018-02-10 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>

> -Original Message-
> From: Wu, Jiaxin
> Sent: Sunday, February 11, 2018 11:15 AM
> To: edk2-devel@lists.01.org
> Cc: Laszlo Ersek <ler...@redhat.com>; Kinney, Michael D
> <michael.d.kin...@intel.com>; Zimmer, Vincent <vincent.zim...@intel.com>;
> Yao, Jiewen <jiewen....@intel.com>; Ye, Ting <ting...@intel.com>; Fu,
> Siyuan <siyuan...@intel.com>; Wu, Jiaxin <jiaxin...@intel.com>
> Subject: [PATCH v2 0/2] NetworkPkg: Support the platform to configure
> HTTPS CipherList.
> 
> V2:
> * Rename the file/variable name.
> * Refine the error handling returned from GetVariable.
> 
> Cc: Laszlo Ersek <ler...@redhat.com>
> Cc: Kinney Michael D <michael.d.kin...@intel.com>
> Cc: Zimmer Vincent <vincent.zim...@intel.com>
> Cc: Yao Jiewen <jiewen@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
> 
> Jiaxin Wu (2):
>   NetworkPkg: Define one private variable for HTTPS to set Tls
> CipherList.
>   NetworkPkg: Read HttpTlsCipherList variable and configure it for HTTPS
> session.
> 
>  NetworkPkg/HttpDxe/HttpDriver.h |  3 +-
>  NetworkPkg/HttpDxe/HttpDxe.inf  |  3 +-
>  NetworkPkg/HttpDxe/HttpsSupport.c   | 92
> -
>  NetworkPkg/Include/Guid/HttpTlsCipherList.h | 38 
>  NetworkPkg/NetworkPkg.dec   |  3 +
>  5 files changed, 136 insertions(+), 3 deletions(-)
>  create mode 100644 NetworkPkg/Include/Guid/HttpTlsCipherList.h
> 
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 0/5] MdeModulePkg/DxeHttpLib: Fix series issues in DxeHttpLib.

2017-12-25 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>

> -Original Message-
> From: Wu, Jiaxin
> Sent: Tuesday, December 26, 2017 9:34 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting...@intel.com>; Fu, Siyuan <siyuan...@intel.com>; Wang,
> Fan <fan.w...@intel.com>; Wu, Jiaxin <jiaxin...@intel.com>
> Subject: [Patch 0/5] MdeModulePkg/DxeHttpLib: Fix series issues in
> DxeHttpLib.
> 
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Cc: Wang Fan <fan.w...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
> 
> Jiaxin Wu (5):
>   MdeModulePkg/DxeHttpLib: Add boundary condition check.
>   MdeModulePkg/DxeHttpLib: Avoid the potential memory leak when error
> happen.
>   MdeModulePkg/DxeHttpLib: Check the input parameters for some APIs.
>   MdeModulePkg/DxeHttpLib: Correct some return Status.
>   MdeModulePkg/DxeHttpLib: Refine some coding style.
> 
>  MdeModulePkg/Include/Library/HttpLib.h   |  10 +-
>  MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 190 +-
> -
>  2 files changed, 125 insertions(+), 75 deletions(-)
> 
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch 4/5] NetworkPkg: Add assert for buffer pointer from DHCP driver.

2018-01-01 Thread Fu Siyuan
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.

Cc: Ye Ting <ting...@intel.com>
Cc: Wu Jiaxin <jiaxin...@intel.com>
Cc: Wang Fan <fan.w...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan...@intel.com>
---
 NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c 
b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
index 9c33835759..b2c03eb269 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
@@ -1210,6 +1210,8 @@ PxeBcDhcp4CallBack (
 return EFI_SUCCESS;
   }
 
+  ASSERT (Packet != NULL);
+
   Private   = (PXEBC_PRIVATE_DATA *) Context;
   Mode  = Private->PxeBc.Mode;
   Callback  = Private->PxeBcCallback;
@@ -1305,6 +1307,8 @@ PxeBcDhcp4CallBack (
 break;
 
   case Dhcp4SelectOffer:
+ASSERT (NewPacket != NULL);
+
 //
 // Select offer by the default policy or by order, and record the 
SelectIndex
 // and SelectProxyType.
-- 
2.13.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch 2/5] NetworkPkg: Check allocated buffer pointer before use.

2018-01-01 Thread Fu Siyuan
Cc: Ye Ting <ting...@intel.com>
Cc: Wu Jiaxin <jiaxin...@intel.com>
Cc: Wang Fan <fan.w...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan...@intel.com>
---
 NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c 
b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c
index f2239fd8c0..327b4cf1cf 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c
@@ -2,7 +2,7 @@
   Functions implementation related with DHCPv6 for UefiPxeBc Driver.
 
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
-  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
+  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
@@ -2030,6 +2030,9 @@ PxeBcDhcp6CallBack (
   SelectAd   = >OfferBuffer[Private->SelectIndex - 
1].Dhcp6.Packet.Offer;
   *NewPacket = AllocateZeroPool (SelectAd->Size);
   ASSERT (*NewPacket != NULL);
+  if (*NewPacket == NULL) {
+return EFI_ABORTED;
+  }
   CopyMem (*NewPacket, SelectAd, SelectAd->Size);
 }
 break;
-- 
2.13.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch 0/5] Refine PXE driver code logic

2018-01-01 Thread Fu Siyuan
See each patch file for details.

Fu Siyuan (5):
  NetworkPkg: Abort the PXE process if DHCP has been started by other
instance.
  NetworkPkg: Check allocated buffer pointer before use.
  NetworkPkg: Fix memory leak problem in PXE driver.
  NetworkPkg: Add assert for buffer pointer from DHCP driver.
  NetworkPkg: Update PXE driver to check for NULL pointer before use it.

 NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c  | 13 ++---
 NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c  | 32 +---
 NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c |  5 -
 NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c   | 20 
 4 files changed, 43 insertions(+), 27 deletions(-)

-- 
2.13.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch 5/5] NetworkPkg: Update PXE driver to check for NULL pointer before use it.

2018-01-01 Thread Fu Siyuan
This patch is to fix the issue that dereferencing of "This" 
(EFI_LOAD_FILE_PROTOCOL)
in EfiPxeLoadFile() is happening before the NULL check.

Cc: Ye Ting <ting...@intel.com>
Cc: Wu Jiaxin <jiaxin...@intel.com>
Cc: Wang Fan <fan.w...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan...@intel.com>
---
 NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c | 20 
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c 
b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
index dc77d256f8..93f3bfa5ba 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
@@ -1,7 +1,7 @@
 /** @file
   This implementation of EFI_PXE_BASE_CODE_PROTOCOL and EFI_LOAD_FILE_PROTOCOL.
 
-  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
+  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
@@ -2349,26 +2349,22 @@ EfiPxeLoadFile (
   EFI_STATUS  Status;
   EFI_STATUS  MediaStatus;
 
-  if (FilePath == NULL || !IsDevicePathEnd (FilePath)) {
+  if (This == NULL || BufferSize == NULL || FilePath == NULL || 
!IsDevicePathEnd (FilePath)) {
 return EFI_INVALID_PARAMETER;
   }
   
-  VirtualNic = PXEBC_VIRTUAL_NIC_FROM_LOADFILE (This);
-  Private= VirtualNic->Private;
-  PxeBc  = >PxeBc;
-  UsingIpv6  = FALSE;
-  Status = EFI_DEVICE_ERROR;
-
-  if (This == NULL || BufferSize == NULL) {
-return EFI_INVALID_PARAMETER;
-  }
-
   //
   // Only support BootPolicy
   //
   if (!BootPolicy) {
 return EFI_UNSUPPORTED;
   }
+  
+  VirtualNic = PXEBC_VIRTUAL_NIC_FROM_LOADFILE (This);
+  Private= VirtualNic->Private;
+  PxeBc  = >PxeBc;
+  UsingIpv6  = FALSE;
+  Status = EFI_DEVICE_ERROR;
 
   //
   // Check media status before PXE start
-- 
2.13.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch 1/5] NetworkPkg: Abort the PXE process if DHCP has been started by other instance.

2018-01-01 Thread Fu Siyuan
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.

Cc: Ye Ting <ting...@intel.com>
Cc: Wu Jiaxin <jiaxin...@intel.com>
Cc: Wang Fan <fan.w...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan...@intel.com>
---
 NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c 
b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
index 101c65824a..9c33835759 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
@@ -1,7 +1,7 @@
 /** @file
   Functions implementation related with DHCPv4 for UefiPxeBc Driver.
 
-  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
+  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
@@ -1697,13 +1697,8 @@ PxeBcDhcp4Dora (
   ZeroMem (Private->OfferCount, sizeof (Private->OfferCount));
   ZeroMem (Private->OfferIndex, sizeof (Private->OfferIndex));
 
-  //
-  // Start DHCPv4 D.O.R.A. process to acquire IPv4 address. This may 
-  // have already been done, thus do not leave in error if the return
-  // code is EFI_ALREADY_STARTED.
-  //
   Status = Dhcp4->Start (Dhcp4, NULL);
-  if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {
+  if (EFI_ERROR (Status)) {
 if (Status == EFI_ICMP_ERROR) {
   PxeMode->IcmpErrorReceived = TRUE;
 }
-- 
2.13.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch 3/5] NetworkPkg: Fix memory leak problem in PXE driver.

2018-01-01 Thread Fu Siyuan
Cc: Ye Ting <ting...@intel.com>
Cc: Wu Jiaxin <jiaxin...@intel.com>
Cc: Wang Fan <fan.w...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan...@intel.com>
---
 NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c  | 27 +--
 NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c |  5 -
 2 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c 
b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c
index 327b4cf1cf..7c2baa8eac 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c
@@ -548,6 +548,7 @@ PxeBcExtractBootFileUrl (
 if (ModeStr != NULL && *(ModeStr + AsciiStrLen (";mode=octet")) == '\0') {
   *ModeStr = '\0';
 } else if (AsciiStrStr (BootFileNamePtr, ";mode=") != NULL) {
+  FreePool (TmpStr);
   return EFI_INVALID_PARAMETER;
 }
 
@@ -1005,7 +1006,7 @@ PxeBcRequestBootService (
 );
 
   if (EFI_ERROR (Status)) {
-return Status;
+goto ON_ERROR;
   }
 
   //
@@ -1020,7 +1021,7 @@ PxeBcRequestBootService (
   //
   Status = Private->Udp6Read->Configure (Private->Udp6Read, 
>Udp6CfgData);
   if (EFI_ERROR (Status)) {
-return Status;
+goto ON_ERROR;
   }
 
   Status = PxeBc->UdpRead (
@@ -1041,7 +1042,7 @@ PxeBcRequestBootService (
   Private->Udp6Read->Configure (Private->Udp6Read, NULL);
 
   if (EFI_ERROR (Status)) {
-return Status;
+goto ON_ERROR;
   }
 
   //
@@ -1050,6 +1051,13 @@ PxeBcRequestBootService (
   Reply->Length = (UINT32) ReadSize;
 
   return EFI_SUCCESS;
+  
+ON_ERROR:
+  if (Discover != NULL) {
+FreePool (Discover);
+  }
+
+  return Status;
 }
 
 
@@ -2158,7 +2166,7 @@ PxeBcDhcp6Discover (
 (VOID *) Discover
 );
   if (EFI_ERROR (Status)) {
-return Status;
+goto ON_ERROR;
   }
 
   //
@@ -2178,7 +2186,7 @@ PxeBcDhcp6Discover (
   //
   Status = Private->Udp6Read->Configure (Private->Udp6Read, 
>Udp6CfgData);
   if (EFI_ERROR (Status)) {
-return Status;
+goto ON_ERROR;
   }
   
   Status = PxeBc->UdpRead (
@@ -2198,10 +2206,17 @@ PxeBcDhcp6Discover (
   //
   Private->Udp6Read->Configure (Private->Udp6Read, NULL);
   if (EFI_ERROR (Status)) {
-return Status;
+goto ON_ERROR;
   }
 
   return EFI_SUCCESS;
+
+ON_ERROR:
+  if (Discover != NULL) {
+FreePool (Discover);
+  }
+
+  return Status;
 }
 
 
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c 
b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
index 09c5753ad9..8dd787be1a 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
@@ -2,7 +2,7 @@
   Driver Binding functions implementationfor for UefiPxeBc Driver.
 
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
-  Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
@@ -254,6 +254,7 @@ PxeBcDestroyIp4Children (
>PxeBc,
NULL
);
+FreePool (Private->Ip4Nic->DevicePath);
 
 if (Private->Snp != NULL) { 
   //
@@ -414,6 +415,8 @@ PxeBcDestroyIp6Children (
>PxeBc,
NULL
);
+FreePool (Private->Ip6Nic->DevicePath);
+
 if (Private->Snp != NULL) {
   //
   // Close SNP from the child virtual handle
-- 
2.13.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 0/2] NetworkPkg/HttpDxe: Fix some issues in HttpDxe

2017-12-26 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jiaxin Wu
> Sent: Tuesday, December 26, 2017 2:35 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting...@intel.com>; Wang, Fan <fan.w...@intel.com>; Fu,
> Siyuan <siyuan...@intel.com>; Wu, Jiaxin <jiaxin...@intel.com>
> Subject: [edk2] [Patch 0/2] NetworkPkg/HttpDxe: Fix some issues in HttpDxe
> 
> Cc: Wang Fan <fan.w...@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
> 
> Jiaxin Wu (2):
>   NetworkPkg/HttpDxe: Fix the memory leak issue in HttpRequest().
>   NetworkPkg/HttpDxe: Remove the unnecessary ASSERT.
> 
>  NetworkPkg/HttpDxe/HttpImpl.c | 17 -
>  1 file changed, 8 insertions(+), 9 deletions(-)
> 
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 3/3] NetworkPkg/TcpDxe: Check TCP payload for release version.

2017-12-26 Thread Fu, Siyuan
Hi, Jiaxin

I think it's better to return a Boolean type than int 0-1 value in 
TcpTrimSegment().
Other part of good to me.


Reviewed-by: Fu Siyuan <siyuan...@intel.com>



> -Original Message-
> From: Wu, Jiaxin
> Sent: Tuesday, December 26, 2017 2:50 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting...@intel.com>; Fu, Siyuan <siyuan...@intel.com>; Wang,
> Fan <fan.w...@intel.com>; Wu, Jiaxin <jiaxin...@intel.com>
> Subject: [Patch 3/3] NetworkPkg/TcpDxe: Check TCP payload for release
> version.
> 
> 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...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Cc: Wang Fan <fan.w...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
> ---
>  NetworkPkg/TcpDxe/TcpInput.c  | 125 +
> -
>  NetworkPkg/TcpDxe/TcpOutput.c |  29 +++---
>  2 files changed, 122 insertions(+), 32 deletions(-)
> 
> diff --git a/NetworkPkg/TcpDxe/TcpInput.c b/NetworkPkg/TcpDxe/TcpInput.c
> index f8845dc..92a0ab8 100644
> --- a/NetworkPkg/TcpDxe/TcpInput.c
> +++ b/NetworkPkg/TcpDxe/TcpInput.c
> @@ -279,12 +279,15 @@ TcpComputeRtt (
> 
>@param[in]  Nbuf The buffer that contains a received TCP segment
> without an IP header.
>@param[in]  Left The sequence number of the window's left edge.
>@param[in]  RightThe sequence number of the window's right edge.
> 
> +  @retval 0The segment is broken.
> +  @retval 1The segment is in good shape.
> +
>  **/
> -VOID
> +INTN
>  TcpTrimSegment (
>IN NET_BUF   *Nbuf,
>IN TCP_SEQNO Left,
>IN TCP_SEQNO Right
>)
> @@ -304,11 +307,11 @@ TcpTrimSegment (
>  TCP_CLEAR_FLG (Seg->Flag, TCP_FLG_SYN);
>  TCP_CLEAR_FLG (Seg->Flag, TCP_FLG_FIN);
> 
>  Seg->Seq = Seg->End;
>  NetbufTrim (Nbuf, Nbuf->TotalSize, NET_BUF_HEAD);
> -return;
> +return 1;
>}
> 
>//
>// Adjust the buffer header
>//
> @@ -357,27 +360,30 @@ TcpTrimSegment (
>  if (Drop != 0) {
>NetbufTrim (Nbuf, Drop, NET_BUF_TAIL);
>  }
>}
> 
> -  ASSERT (TcpVerifySegment (Nbuf) != 0);
> +  return TcpVerifySegment (Nbuf);
>  }
> 
>  /**
>Trim off the data outside the tcb's receive window.
> 
>@param[in]  Tcb  Pointer to the TCP_CB of this TCP instance.
>@param[in]  Nbuf Pointer to the NET_BUF containing the received tcp
> segment.
> 
> +  @retval 0The segment is broken.
> +  @retval 1The segment is in good shape.
> +
>  **/
> -VOID
> +INTN
>  TcpTrimInWnd (
>IN TCP_CB  *Tcb,
>IN NET_BUF *Nbuf
>)
>  {
> -  TcpTrimSegment (Nbuf, Tcb->RcvNxt, Tcb->RcvWl2 + Tcb->RcvWnd);
> +  return TcpTrimSegment (Nbuf, Tcb->RcvNxt, Tcb->RcvWl2 + Tcb->RcvWnd);
>  }
> 
>  /**
>Process the data and FIN flag, and check whether to deliver
>data to the socket layer.
> @@ -419,11 +425,20 @@ TcpDeliverData (
> 
>while (Entry != >RcvQue) {
>  Nbuf  = NET_LIST_USER_STRUCT (Entry, NET_BUF, List);
>  Seg   = TCPSEG_NETBUF (Nbuf);
> 
> -ASSERT (TcpVerifySegment (Nbuf) != 0);
> +if (TcpVerifySegment (Nbuf) == 0) {
> +  DEBUG (
> +(EFI_D_ERROR,
> +"TcpToSendData: discard a broken segment for TCB %p\n",
> +Tcb)
> +);
> +  NetbufFree (Nbuf);
> +  return -1;
> +}
> +
>  ASSERT (Nbuf->Tcp == NULL);
> 
>  if (TCP_SEQ_GT (Seg->Seq, Seq)) {
>break;
>  }
> @@ -559,12 +574,15 @@ TcpDeliverData (
>Store the data into the reassemble queue.
> 
>@param[in, out]  Tcb   Pointer to the TCP_CB of this TCP instance.
>@param[in]   Nbuf  Pointer to the buffer containing the data to be
> queued.
> 
> +  @retval  0 An error condition occurred.
> +  @retval  1 No error occurred to queue data.
> +
>  **/
> -VOID
> +INTN
>  TcpQueueData (
>IN OUT TCP_CB  *Tcb,
>IN NET_BUF *Nbuf
>)
>  {
> @@ -586,11 +604,11 @@ TcpQueueData (
>// no out-of-order segments are received.
>//
>if (IsListEmpty (Head)) {
> 
>  InsertTailList (Head, >List);
> -return;
> +return 1;
>}

Re: [edk2] [Patch 0/5] Refine PXE driver code logic

2018-01-03 Thread Fu, Siyuan
Hi, Sriram

So far as I know we don't have plan to remove the MdeModulePkg copy, but we are 
taking priority to fix the NetworkPkg ones for these duplicate drivers. 

BestRegards
Fu Siyuan

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Subramanian, Sriram
> Sent: Tuesday, January 2, 2018 1:51 PM
> To: Fu, Siyuan <siyuan...@intel.com>; edk2-devel@lists.01.org
> Subject: Re: [edk2] [Patch 0/5] Refine PXE driver code logic
> 
> Hi Siyuan,
> 
> Some of these problems also exist in the
> MdeModulePkg/Universal/Network/UefiPxeBcDxe/. Is there a plan to fix them
> there as well, or will the MdeModulePkg copy of the drivers be removed
> sometime in the near future?
> 
> Thanks,
> Sriram.
> 
> -Original Message-
> From: Subramanian, Sriram
> Sent: Tuesday, January 2, 2018 11:15 AM
> To: 'Fu Siyuan' <siyuan...@intel.com>; edk2-devel@lists.01.org
> Subject: RE: [edk2] [Patch 0/5] Refine PXE driver code logic
> 
> Patch Series Reviewed-by: Sriram Subramanian <srira...@hpe.com>
> 
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Fu
> Siyuan
> Sent: Tuesday, January 2, 2018 10:58 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [Patch 0/5] Refine PXE driver code logic
> 
> See each patch file for details.
> 
> Fu Siyuan (5):
>   NetworkPkg: Abort the PXE process if DHCP has been started by other
> instance.
>   NetworkPkg: Check allocated buffer pointer before use.
>   NetworkPkg: Fix memory leak problem in PXE driver.
>   NetworkPkg: Add assert for buffer pointer from DHCP driver.
>   NetworkPkg: Update PXE driver to check for NULL pointer before use it.
> 
>  NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c  | 13 ++---
>  NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c  | 32 +-
> --
>  NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c |  5 -
>  NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c   | 20 
>  4 files changed, 43 insertions(+), 27 deletions(-)
> 
> --
> 2.13.0.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] MdeModulePkg/DxeUdpIoLib: Did some code enhancement for UdpIoLib

2018-01-03 Thread Fu, Siyuan
Hi, Fan

+  If Udp version is not Udp4 or Udp6, then ASSERT().
It's better to update "Udp4" and "Udp6" to " UDP_IO_UDP4_VERSION" and " 
UDP_IO_UDP6_VERSION"

Other parts are good with me.


Reviewed-by: Fu Siyuan <siyuan...@intel.com>


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> fanwang2
> Sent: Thursday, January 4, 2018 2:02 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting...@intel.com>; Wang, Fan <fan.w...@intel.com>; Fu,
> Siyuan <siyuan...@intel.com>; Wu, Jiaxin <jiaxin...@intel.com>
> Subject: [edk2] [Patch] MdeModulePkg/DxeUdpIoLib: Did some code
> enhancement for UdpIoLib
> 
> From: Wang Fan <fan.w...@intel.com>
> 
> * Added some ASSERT descriptions for library APIs.
> * Added "Optional" option for Context parameter in UdpIoCancelDgrams().
> * Added function return status check for UdpIoFreeIo().
> 
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Cc: Jiaxin Wu <jiaxin...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wang Fan <fan.w...@intel.com>
> ---
>  MdeModulePkg/Include/Library/UdpIoLib.h| 16 -
>  MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.c | 90 ++---
> -
>  2 files changed, 78 insertions(+), 28 deletions(-)
> 
> diff --git a/MdeModulePkg/Include/Library/UdpIoLib.h
> b/MdeModulePkg/Include/Library/UdpIoLib.h
> index e0b44ce..86a11a9 100644
> --- a/MdeModulePkg/Include/Library/UdpIoLib.h
> +++ b/MdeModulePkg/Include/Library/UdpIoLib.h
> @@ -195,11 +195,13 @@ BOOLEAN
>IN VOID   *Context
>);
> 
>  /**
>Cancel all the sent datagram that pass the selection criteria of
> ToCancel.
> +
>If ToCancel is NULL, all the datagrams are cancelled.
> +  If Udp version is not Udp4 or Udp6, then ASSERT().
> 
>@param[in]  UdpIo The UDP_IO to cancel packet.
>@param[in]  IoStatus  The IoStatus to return to the packet
> owners.
>@param[in]  ToCancel  The select funtion to test whether to
> cancel this
>  packet or not.
> @@ -210,17 +212,20 @@ VOID
>  EFIAPI
>  UdpIoCancelDgrams (
>IN UDP_IO *UdpIo,
>IN EFI_STATUS IoStatus,
>IN UDP_IO_TO_CANCEL   ToCancel,OPTIONAL
> -  IN VOID   *Context
> +  IN VOID   *Context OPTIONAL
>);
> 
>  /**
>Creates a UDP_IO to access the UDP service. It creates and configures
>a UDP child.
> 
> +  If Configure is NULL, then ASSERT().
> +  If Udp version is not Udp4 or Udp6, then ASSERT().
> +
>It locates the UDP service binding prototype on the Controller
> parameter
>uses the UDP service binding prototype to create a UDP child (also
> known as
>a UDP instance) configures the UDP child by calling Configure function
> prototype.
>Any failures in creating or configuring the UDP child return NULL for
> failure.
> 
> @@ -245,15 +250,18 @@ UdpIoCreateIo (
>);
> 
>  /**
>Free the UDP_IO and all its related resources.
> 
> +  If Udp version is not Udp4 or Udp6, then ASSERT().
> +
>The function cancels all sent datagrams and receive requests.
> 
>@param[in]  UdpIo The UDP_IO to free.
> 
>@retval EFI_SUCCESS   The UDP_IO is freed.
> +  @retval OthersFailed to free UDP_IO.
> 
>  **/
>  EFI_STATUS
>  EFIAPI
>  UdpIoFreeIo (
> @@ -262,10 +270,12 @@ UdpIoFreeIo (
> 
>  /**
>Cleans up the UDP_IO without freeing it. Call this function
>if you intend to later re-use the UDP_IO.
> 
> +  If Udp version is not Udp4 or Udp6, then ASSERT().
> +
>This function releases all transmitted datagrams and receive requests
> and configures NULL for the UDP instance.
> 
>@param[in]  UdpIo The UDP_IO to clean up.
> 
>  **/
> @@ -276,10 +286,12 @@ UdpIoCleanIo (
>);
> 
>  /**
>Send a packet through the UDP_IO.
> 
> +  If Udp version is not Udp4 or Udp6, then ASSERT().
> +
>The packet will be wrapped in UDP_TX_TOKEN. Function Callback will be
> called
>when the packet is sent. The optional parameter EndPoint overrides the
> default
>address pair if specified.
> 
>@param[in]  UdpIo The UDP_IO to send the packet through.
> @@ -322,10 +334,12 @@ UdpIoCancelSentDatagram (
>);
> 
>  /**
>Issue a receive request to the UDP_IO.
> 
> +  If Udp version is not Udp4 or Udp6, then ASSERT().
> +
>Th

Re: [edk2] [Patch] NetworkPkg/HttpDxe: Stripped square brackets in IPv6 expressed HostName.

2018-07-31 Thread Fu, Siyuan
OK, the patch is good with me.

Reviewed-by: Fu Siyuan 


> -Original Message-
> From: Wu, Jiaxin
> Sent: Wednesday, August 1, 2018 10:42 AM
> To: Fu, Siyuan ; edk2-devel@lists.01.org
> Cc: Ye, Ting ; Laszlo Ersek 
> Subject: RE: [Patch] NetworkPkg/HttpDxe: Stripped square brackets in IPv6
> expressed HostName.
> 
> Hi Siyuan,
> 
> Even we have one lib for us to get the IPv6 address, I still prefer to use
> the patch did, because the format returned from the HttpUrlGetIp6 is
> EFI_IPv6_ADDRESS, we have to transform it to CHAR8, which means we also
> need another lib included here to do that. Actually, the patch is quite
> simply even than API did. What do you think?
> 
> Thanks,
> Jiaxin
> 
> > -Original Message-
> > From: Fu, Siyuan
> > Sent: Wednesday, August 1, 2018 10:06 AM
> > To: Wu, Jiaxin ; edk2-devel@lists.01.org
> > Cc: Ye, Ting ; Laszlo Ersek 
> > Subject: RE: [Patch] NetworkPkg/HttpDxe: Stripped square brackets in
> IPv6
> > expressed HostName.
> >
> > Hi, Jiaxin
> >
> > The HttpLib already has HttpUrlGetIp6() for this.
> >
> > BestRegards
> > Fu Siyuan
> >
> > > -----Original Message-
> > > From: Wu, Jiaxin
> > > Sent: Wednesday, August 1, 2018 9:55 AM
> > > To: edk2-devel@lists.01.org
> > > Cc: Ye, Ting ; Fu, Siyuan ;
> Laszlo
> > > Ersek ; Wu, Jiaxin 
> > > Subject: [Patch] NetworkPkg/HttpDxe: Stripped square brackets in IPv6
> > > expressed HostName.
> > >
> > > 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 
> > > Cc: Fu Siyuan 
> > > Cc: Laszlo Ersek 
> > > Contributed-under: TianoCore Contribution Agreement 1.0
> > > Signed-off-by: Wu Jiaxin 
> > > ---
> > >  NetworkPkg/HttpDxe/HttpImpl.c | 17 ++---
> > >  1 file changed, 14 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/NetworkPkg/HttpDxe/HttpImpl.c
> > b/NetworkPkg/HttpDxe/HttpImpl.c
> > > index 17deceb395..e05ee9344b 100644
> > > --- a/NetworkPkg/HttpDxe/HttpImpl.c
> > > +++ b/NetworkPkg/HttpDxe/HttpImpl.c
> > > @@ -403,14 +403,25 @@ EfiHttpRequest (
> > >  Status = HttpParseUrl (Url, (UINT32) AsciiStrLen (Url), FALSE,
> > > );
> > >  if (EFI_ERROR (Status)) {
> > >goto Error1;
> > >  }
> > >
> > > -HostName   = NULL;
> > > -Status = HttpUrlGetHostName (Url, UrlParser, );
> > > +Status = HttpUrlGetHostName (Url, UrlParser, );
> > >  if (EFI_ERROR (Status)) {
> > > - goto Error1;
> > > +  goto Error1;
> > > +}
> > > +
> > > +if (HttpInstance->LocalAddressIsIPv6 && AsciiStrSize (HostName) >
> 2
> > > &&
> > > +HostName[0] == '[' && *(HostName + (AsciiStrSize (HostName) -
> 2))
> > > == ']') {
> > > +  //
> > > +  // HostName format is expressed as IPv6, so, remove '[' and ']'.
> > > +  //
> > > +  HostNameSize = AsciiStrSize (HostName) - 2;
> > > +
> > > +  CopyMem (HostName, HostName + 1, HostNameSize - 1);
> > > +
> > > +  *(HostName + HostNameSize - 1) = '\0';
> > >  }
> > >
> > >  Status = HttpUrlGetPort (Url, UrlParser, );
> > >  if (EFI_ERROR (Status)) {
> > >if (HttpInstance->UseHttps) {
> > > --
> > > 2.17.1.windows.2

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] NetworkPkg/HttpDxe: Stripped square brackets in IPv6 expressed HostName.

2018-07-31 Thread Fu, Siyuan
Hi, Jiaxin

The HttpLib already has HttpUrlGetIp6() for this.

BestRegards
Fu Siyuan

> -Original Message-
> From: Wu, Jiaxin
> Sent: Wednesday, August 1, 2018 9:55 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting ; Fu, Siyuan ; Laszlo
> Ersek ; Wu, Jiaxin 
> Subject: [Patch] NetworkPkg/HttpDxe: Stripped square brackets in IPv6
> expressed HostName.
> 
> 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 
> Cc: Fu Siyuan 
> Cc: Laszlo Ersek 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin 
> ---
>  NetworkPkg/HttpDxe/HttpImpl.c | 17 ++---
>  1 file changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
> index 17deceb395..e05ee9344b 100644
> --- a/NetworkPkg/HttpDxe/HttpImpl.c
> +++ b/NetworkPkg/HttpDxe/HttpImpl.c
> @@ -403,14 +403,25 @@ EfiHttpRequest (
>  Status = HttpParseUrl (Url, (UINT32) AsciiStrLen (Url), FALSE,
> );
>  if (EFI_ERROR (Status)) {
>goto Error1;
>  }
> 
> -HostName   = NULL;
> -Status = HttpUrlGetHostName (Url, UrlParser, );
> +Status = HttpUrlGetHostName (Url, UrlParser, );
>  if (EFI_ERROR (Status)) {
> - goto Error1;
> +  goto Error1;
> +}
> +
> +if (HttpInstance->LocalAddressIsIPv6 && AsciiStrSize (HostName) > 2
> &&
> +HostName[0] == '[' && *(HostName + (AsciiStrSize (HostName) - 2))
> == ']') {
> +  //
> +  // HostName format is expressed as IPv6, so, remove '[' and ']'.
> +  //
> +  HostNameSize = AsciiStrSize (HostName) - 2;
> +
> +  CopyMem (HostName, HostName + 1, HostNameSize - 1);
> +
> +  *(HostName + HostNameSize - 1) = '\0';
>  }
> 
>  Status = HttpUrlGetPort (Url, UrlParser, );
>  if (EFI_ERROR (Status)) {
>if (HttpInstance->UseHttps) {
> --
> 2.17.1.windows.2

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] NetworkPkg: Remove the redundant code and definition.

2018-08-12 Thread Fu, Siyuan
Hi, Songpeng

The patch is good with me, please remember to update the copyright year when 
commit it.

Reviewed-by: Fu Siyuan 

> -Original Message-
> From: Li, Songpeng
> Sent: Monday, August 13, 2018 10:45 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Jiaxin ; Fu, Siyuan 
> Subject: [PATCH] NetworkPkg: Remove the redundant code and definition.
> 
> Cc: Jiaxin Wu 
> Cc: Siyuan Fu 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1064
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Songpeng Li 
> ---
>  NetworkPkg/IScsiDxe/IScsiDxe.inf |  1 -
>  NetworkPkg/IScsiDxe/IScsiProto.c | 33 
>  NetworkPkg/IpSecDxe/Ikev2/Payload.c  | 18 ---
>  NetworkPkg/IpSecDxe/Ikev2/Utility.c  | 76 
>  NetworkPkg/IpSecDxe/Ikev2/Utility.h  | 67 
>  NetworkPkg/TcpDxe/TcpOption.c| 30 ---
>  NetworkPkg/TcpDxe/TcpOption.h| 16 --
>  NetworkPkg/TlsDxe/TlsDxe.inf |  1 -
>  NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c | 23 -
>  NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.h | 10 
>  10 files changed, 275 deletions(-)
> 
> diff --git a/NetworkPkg/IScsiDxe/IScsiDxe.inf
> b/NetworkPkg/IScsiDxe/IScsiDxe.inf
> index 2d96611b44..60737c96ab 100644
> --- a/NetworkPkg/IScsiDxe/IScsiDxe.inf
> +++ b/NetworkPkg/IScsiDxe/IScsiDxe.inf
> @@ -124,7 +124,6 @@
>gEfiIfrTianoGuid  ## SOMETIMES_PRODUCES ##
> UNDEFINED
>gEfiAcpiTableGuid ## SOMETIMES_CONSUMES ##
> SystemTable
>gEfiAcpi10TableGuid   ## SOMETIMES_CONSUMES ##
> SystemTable
> -  gEfiAcpi20TableGuid   ## SOMETIMES_CONSUMES ##
> SystemTable
>gEfiAdapterInfoNetworkBootGuid## SOMETIMES_CONSUMES ##
> UNDEFINED
>gEfiAdapterInfoUndiIpv6SupportGuid## SOMETIMES_CONSUMES ##
> GUID
> 
> diff --git a/NetworkPkg/IScsiDxe/IScsiProto.c
> b/NetworkPkg/IScsiDxe/IScsiProto.c
> index 7619360568..f4a49c677a 100644
> --- a/NetworkPkg/IScsiDxe/IScsiProto.c
> +++ b/NetworkPkg/IScsiDxe/IScsiProto.c
> @@ -2096,39 +2096,6 @@ IScsiDelTcb (
>  }
> 
> 
> -/**
> -  Find the task control block by the initator task tag.
> -
> -  @param[in]  TcbList The tcb list.
> -  @param[in]  InitiatorTaskTag The initiator task tag.
> -
> -  @return The task control block found.
> -  @retval NULL The task control block cannot be found.
> -
> -**/
> -ISCSI_TCB *
> -IScsiFindTcbByITT (
> -  IN LIST_ENTRY  *TcbList,
> -  IN UINT32  InitiatorTaskTag
> -  )
> -{
> -  ISCSI_TCB   *Tcb;
> -  LIST_ENTRY  *Entry;
> -
> -  Tcb = NULL;
> -
> -  NET_LIST_FOR_EACH (Entry, TcbList) {
> -Tcb = NET_LIST_USER_STRUCT (Entry, ISCSI_TCB, Link);
> -
> -if (Tcb->InitiatorTaskTag == InitiatorTaskTag) {
> -  break;
> -}
> -  }
> -
> -  return Tcb;
> -}
> -
> -
>  /**
>Create a data segment, pad it, and calculate the CRC if needed.
> 
> diff --git a/NetworkPkg/IpSecDxe/Ikev2/Payload.c
> b/NetworkPkg/IpSecDxe/Ikev2/Payload.c
> index 218c26f934..1bb5e2e5e5 100644
> --- a/NetworkPkg/IpSecDxe/Ikev2/Payload.c
> +++ b/NetworkPkg/IpSecDxe/Ikev2/Payload.c
> @@ -3104,24 +3104,6 @@ ON_EXIT:
>return Status;
>  }
> 
> -/**
> -  Save some useful payloads after accepting the Packet.
> -
> -  @param[in] SessionCommon   Pointer to IKEV2_SESSION_COMMON related to
> the operation.
> -  @param[in] IkePacket   Pointer to received IkePacet.
> -  @param[in] IkeType The type used to indicate it is in IkeSa or
> ChildSa or Info
> - exchange.
> -
> -**/
> -VOID
> -Ikev2OnPacketAccepted (
> -  IN IKEV2_SESSION_COMMON *SessionCommon,
> -  IN IKE_PACKET   *IkePacket,
> -  IN UINT8IkeType
> -  )
> -{
> -  return;
> -}
> 
>  /**
> 
> diff --git a/NetworkPkg/IpSecDxe/Ikev2/Utility.c
> b/NetworkPkg/IpSecDxe/Ikev2/Utility.c
> index 698aba1327..0c9c929705 100644
> --- a/NetworkPkg/IpSecDxe/Ikev2/Utility.c
> +++ b/NetworkPkg/IpSecDxe/Ikev2/Utility.c
> @@ -290,21 +290,6 @@ Ikev2SaSessionRemove (
>return NULL;
>  }
> 
> -/**
> -  Marking a SA session as on deleting.
> -
> -  @param[in]  IkeSaSession  Pointer to IKEV2_SA_SESSION.
> -
> -  @retval EFI_SUCCESS   Find the related SA session and marked it.
> -
> -**/
> -EFI_STATUS
> -Ikev2SaSessionOnDeleting (
> -  IN IKEV2_SA_SESSION  *IkeSaSession
> -  )
> -{
> -  return EFI_SUCCESS;
> -}
> 
>  /**
>Free specified Seession Common. The session common would belong to a
> IKE SA 

Re: [edk2] [PATCH] NetworkPkg: Remove the redundant code and definition.

2018-08-12 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan 



> -Original Message-
> From: Li, Songpeng
> Sent: Thursday, August 9, 2018 4:33 PM
> To: edk2-devel@lists.01.org; Fu, Siyuan ; Wu, Jiaxin
> 
> Cc: Li, Songpeng 
> Subject: [PATCH] NetworkPkg: Remove the redundant code and definition.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Songpeng Li 
> ---
>  NetworkPkg/IScsiDxe/IScsiDxe.inf |  1 -
>  NetworkPkg/IScsiDxe/IScsiProto.c | 33 
>  NetworkPkg/IpSecDxe/Ikev2/Payload.c  | 18 ---
>  NetworkPkg/IpSecDxe/Ikev2/Utility.c  | 76 
>  NetworkPkg/IpSecDxe/Ikev2/Utility.h  | 67 
>  NetworkPkg/TcpDxe/TcpOption.c| 30 ---
>  NetworkPkg/TcpDxe/TcpOption.h| 16 --
>  NetworkPkg/TlsDxe/TlsDxe.inf |  1 -
>  NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c | 23 -
>  NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.h | 10 
>  10 files changed, 275 deletions(-)
> 
> diff --git a/NetworkPkg/IScsiDxe/IScsiDxe.inf
> b/NetworkPkg/IScsiDxe/IScsiDxe.inf
> index 2d96611b44..60737c96ab 100644
> --- a/NetworkPkg/IScsiDxe/IScsiDxe.inf
> +++ b/NetworkPkg/IScsiDxe/IScsiDxe.inf
> @@ -124,7 +124,6 @@
>gEfiIfrTianoGuid  ## SOMETIMES_PRODUCES ##
> UNDEFINED
>gEfiAcpiTableGuid ## SOMETIMES_CONSUMES ##
> SystemTable
>gEfiAcpi10TableGuid   ## SOMETIMES_CONSUMES ##
> SystemTable
> -  gEfiAcpi20TableGuid   ## SOMETIMES_CONSUMES ##
> SystemTable
>gEfiAdapterInfoNetworkBootGuid## SOMETIMES_CONSUMES ##
> UNDEFINED
>gEfiAdapterInfoUndiIpv6SupportGuid## SOMETIMES_CONSUMES ##
> GUID
> 
> diff --git a/NetworkPkg/IScsiDxe/IScsiProto.c
> b/NetworkPkg/IScsiDxe/IScsiProto.c
> index 7619360568..f4a49c677a 100644
> --- a/NetworkPkg/IScsiDxe/IScsiProto.c
> +++ b/NetworkPkg/IScsiDxe/IScsiProto.c
> @@ -2096,39 +2096,6 @@ IScsiDelTcb (
>  }
> 
> 
> -/**
> -  Find the task control block by the initator task tag.
> -
> -  @param[in]  TcbList The tcb list.
> -  @param[in]  InitiatorTaskTag The initiator task tag.
> -
> -  @return The task control block found.
> -  @retval NULL The task control block cannot be found.
> -
> -**/
> -ISCSI_TCB *
> -IScsiFindTcbByITT (
> -  IN LIST_ENTRY  *TcbList,
> -  IN UINT32  InitiatorTaskTag
> -  )
> -{
> -  ISCSI_TCB   *Tcb;
> -  LIST_ENTRY  *Entry;
> -
> -  Tcb = NULL;
> -
> -  NET_LIST_FOR_EACH (Entry, TcbList) {
> -Tcb = NET_LIST_USER_STRUCT (Entry, ISCSI_TCB, Link);
> -
> -if (Tcb->InitiatorTaskTag == InitiatorTaskTag) {
> -  break;
> -}
> -  }
> -
> -  return Tcb;
> -}
> -
> -
>  /**
>Create a data segment, pad it, and calculate the CRC if needed.
> 
> diff --git a/NetworkPkg/IpSecDxe/Ikev2/Payload.c
> b/NetworkPkg/IpSecDxe/Ikev2/Payload.c
> index 218c26f934..1bb5e2e5e5 100644
> --- a/NetworkPkg/IpSecDxe/Ikev2/Payload.c
> +++ b/NetworkPkg/IpSecDxe/Ikev2/Payload.c
> @@ -3104,24 +3104,6 @@ ON_EXIT:
>return Status;
>  }
> 
> -/**
> -  Save some useful payloads after accepting the Packet.
> -
> -  @param[in] SessionCommon   Pointer to IKEV2_SESSION_COMMON related to
> the operation.
> -  @param[in] IkePacket   Pointer to received IkePacet.
> -  @param[in] IkeType The type used to indicate it is in IkeSa or
> ChildSa or Info
> - exchange.
> -
> -**/
> -VOID
> -Ikev2OnPacketAccepted (
> -  IN IKEV2_SESSION_COMMON *SessionCommon,
> -  IN IKE_PACKET   *IkePacket,
> -  IN UINT8IkeType
> -  )
> -{
> -  return;
> -}
> 
>  /**
> 
> diff --git a/NetworkPkg/IpSecDxe/Ikev2/Utility.c
> b/NetworkPkg/IpSecDxe/Ikev2/Utility.c
> index 698aba1327..0c9c929705 100644
> --- a/NetworkPkg/IpSecDxe/Ikev2/Utility.c
> +++ b/NetworkPkg/IpSecDxe/Ikev2/Utility.c
> @@ -290,21 +290,6 @@ Ikev2SaSessionRemove (
>return NULL;
>  }
> 
> -/**
> -  Marking a SA session as on deleting.
> -
> -  @param[in]  IkeSaSession  Pointer to IKEV2_SA_SESSION.
> -
> -  @retval EFI_SUCCESS   Find the related SA session and marked it.
> -
> -**/
> -EFI_STATUS
> -Ikev2SaSessionOnDeleting (
> -  IN IKEV2_SA_SESSION  *IkeSaSession
> -  )
> -{
> -  return EFI_SUCCESS;
> -}
> 
>  /**
>Free specified Seession Common. The session common would belong to a
> IKE SA or
> @@ -659,33 +644,6 @@ Ikev2ChildSaSessionReg (
>return ;
>  }
> 
> -/**
> -  Find the ChildSaSession by it's MessagId.
> -
> -  @param[in] SaSessionList

Re: [edk2] [Patch 1/2] MdeModulePkg/Network: Add 32bit subnet mask support for IP4 PXE boot.

2018-08-28 Thread Fu, Siyuan
Hi, Jiaxin

The IP4 routing logic for /32 subnet mask can be explain as below, maybe I need 
to add it to the commit log or in code comments.

Ip4Output() is called to send a packet
If a matching route cache (src, dest -> xxx) can be find, 
send the packet to address xxx according to the route cache.
else
create a new route cache (src, dest -> dest)
   <- This is done in Ip4Route()
if a default gateway is configured, save it to the route cache 
TAG.<- This is done in Ip4Route()
send the packet to dest 
   <- This is done in Ip4SendFrame()
if ARP resolve failed for dest
find the matching route cache and check TAG to see if 
there is a default gateway  <- This is done in 
Ip4SendFrameToDefaultRoute ()
if yes
update the route cache to (src, dest -> default 
gw)
send the packet to the default gw
    

BestRegards
Fu Siyuan


> -Original Message-
> From: Wu, Jiaxin
> Sent: Tuesday, August 28, 2018 4:53 PM
> To: Fu, Siyuan ; edk2-devel@lists.01.org
> Cc: Ye, Ting 
> Subject: RE: [Patch 1/2] MdeModulePkg/Network: Add 32bit subnet mask
> support for IP4 PXE boot.
> 
> 
> Hi Siyuan,
> 
> Below is my code review understanding, maybe something is wrong, please
> correct me.
> 
> > The "default route" means a route entry with zero SubnetAddress and zero
> > SubnetMask, which will match all the dest address that can't match any
> other
> > non-zero Subnet* route entry.
> > The "instance route table" is a list of route entries which belong to an
> IP child
> > instance.
> > The "default route table" is the route table used by these IP child
> instances
> > with default IP address.
> > A default route (which is just one route entry) may belong to the
> default
> > route table, or any instance route table.
> >
> 
> Yes, I agree. If there is a default route {Dest: 0.0.0.0, Mask: 0.0.0.0,
> NextHope: Gataway} in the instance route table, it must be set via IP-
> >Routes().
> 
> 
> > The new function Ip4SendFrameToDefaultRoute() will always try to send
> the
> > frames to the default entry, so the naming is correct.
> 
> According above, we want to send the packet to the router (Gataway) via
> the default route {Dest: 0.0.0.0, Mask: 0.0.0.0, NextHope: Gataway} info,
> right? But the comments in Ip4Route() said:
>   //
>   // When using /32 subnet mask, the packet will always be sent to the
> direct
>   // destination first, if we can't find a matching route cache.
>   //
> 
> > While how to
> > determine the default route entry is not in this function, the Ip4Route()
> has
> > been updated to handle the /32 subnet mask specially, and Ip4Output()
> will
> > guarantee we check the instance route table first, then default route
> table
> > (the code you quoted).
> 
> After the code I quoted below in Ip4Output(), the route cache entry found
> in Ip4SendFrameToDefaultRoute() is {Dest: X.X.X.X, Src: Y.Y.Y.Y, NextHope:
> X.X.X.X, Tag: { Dest: X.X.X.X, Mask: 255.255.255.255, NextHope:
> 0.0.0.0} }, if so, looks the package will be sent to  NextHope:  0.0.0.0?
> 
> 
> >
> > BestRegards
> > Fu Siyuan
> >
> > > -Original Message-
> > > From: Wu, Jiaxin
> > > Sent: Tuesday, August 28, 2018 2:51 PM
> > > To: Fu, Siyuan ; edk2-devel@lists.01.org
> > > Cc: Ye, Ting 
> > > Subject: RE: [Patch 1/2] MdeModulePkg/Network: Add 32bit subnet mask
> > > support for IP4 PXE boot.
> > >
> > > Hi Siyuan,
> > >
> > > In Ip4SendFrameToDefaultRoute(), you tried to find the default gateway
> IP
> > > address by using the found RtCacheEntry->Tag, I'm confused why it's
> the
> > > default gateway? In my understanding, tag is the cache's corresponding
> > > route entry.  Besides, why we must send the frame to "DefaultRouter",
> > > should be the instance router first, then default router? If so, I
> suggest
> > > to rename the function to Ip4SendFrameToRoute(). Then, the logic in
> the
> > > function to retrieve the gateway should be:
> > > {
> > > if (IpInstance == NULL) {
> > >   CacheEntry = Ip4Route (IpSb->DefaultRouteTable, Head->Dst, Head-
> > >Src,
> > > IpIf->SubnetMask);
> > > } else {
> > >   CacheEntry = Ip4Route (IpInstance->RouteTable, Head->Dst,

[edk2] [PATCH v2] MdeModulePkg/Network: Add 32bit subnet mask support for IP4 PXE boot.

2018-08-29 Thread Fu Siyuan
V2 update:
The original patch has a problem, that if an IP child which not using default 
address is
configured with /32 subnet mask, while the gateway is configured to the default 
route table,
then the gateway won't take effect on that IP child. This patch fixed the 
problem.

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 
Cc: Ye Ting 
Cc: Wu Jiaxin 
---
 MdeModulePkg/Include/Library/NetLib.h |   5 +-
 MdeModulePkg/Library/DxeNetLib/DxeNetLib.c|  13 +-
 .../Universal/Network/Ip4Dxe/Ip4Common.h  |   2 +-
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c | 117 --
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h |   5 +-
 .../Universal/Network/Ip4Dxe/Ip4Impl.c|   2 +-
 .../Universal/Network/Ip4Dxe/Ip4Output.c  |  11 +-
 .../Universal/Network/Ip4Dxe/Ip4Route.c   |  26 +++-
 .../Universal/Network/Ip4Dxe/Ip4Route.h   |   9 +-
 .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c  |   6 +-
 10 files changed, 163 insertions(+), 33 deletions(-)

diff --git a/MdeModulePkg/Include/Library/NetLib.h 
b/MdeModulePkg/Include/Library/NetLib.h
index ef7bc429c1..b7ef99c7b5 100644
--- a/MdeModulePkg/Include/Library/NetLib.h
+++ b/MdeModulePkg/Include/Library/NetLib.h
@@ -422,8 +422,9 @@ NetGetIpClass (
 
   If all bits of the host address of IP are 0 or 1, IP is also not a valid 
unicast address,
   except when the originator is one of the endpoints of a point-to-point link 
with a 31-bit
-  mask (RFC3021).
-
+  mask (RFC3021), or a 32bit NetMask (all 0xFF) is used for special network 
environment (e.g.
+  PPP link).
+  
   @param[in]  IpThe IP to check against.
   @param[in]  NetMask   The mask of the IP.
 
diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c 
b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
index bf8f5523e6..63f4724062 100644
--- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
+++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
@@ -654,8 +654,9 @@ NetGetIpClass (
 
   If all bits of the host address of IP are 0 or 1, IP is also not a valid 
unicast address,
   except when the originator is one of the endpoints of a point-to-point link 
with a 31-bit
-  mask (RFC3021).
-
+  mask (RFC3021), or a 32bit NetMask (all 0xFF) is used for special network 
environment (e.g.
+  PPP link).
+  
   @param[in]  IpThe IP to check against.
   @param[in]  NetMask   The mask of the IP.
 
@@ -669,18 +670,20 @@ NetIp4IsUnicast (
   IN IP4_ADDR   NetMask
   )
 {
+  INTN   MaskLength;
+  
   ASSERT (NetMask != 0);
 
   if (Ip == 0 || IP4_IS_LOCAL_BROADCAST (Ip)) {
 return FALSE;
   }
 
-  if (NetGetMaskLength (NetMask) != 31) {
+  MaskLength = NetGetMaskLength (NetMask);
+  ASSERT ((MaskLength >= 0) && (MaskLength <= IP4_MASK_NUM));
+  if (MaskLength < 31) {
 if (((Ip &~NetMask) == ~NetMask) || ((Ip &~NetMask) == 0)) {
   return FALSE;
 }
-  } else {
-return TRUE;
   }
 
   return TRUE;
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h 
b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h
index e0fffc9d0d..994a81f4de 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h
@@ -55,7 +55,7 @@ typedef struct _IP4_SERVICEIP4_SERVICE;
 /// Compose the fragment field to be used in the IP4 header.
 ///
 #define IP4_HEAD_FRAGMENT_FIELD(Df, Mf, Offset) \
-((UINT16)(((Df) ? 0x4000 : 0) | ((Mf) ? 0x2000 : 0) | (((Offset) >> 3) & 
0x1fff)))
+((UINT16)(((Df) ? IP4_HEAD_DF_MASK : 0) | ((Mf) ? IP4_HEAD_MF_MASK : 0) | 
(((Offset) >> 3) & IP4_HEAD_OFFSET_MASK)))
 
 #define IP4_LAST_FRAGMENT(FragmentField)  \
   (((FragmentField) & IP4_HEAD_MF_MASK) == 0)
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c 
b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c
index 6e0e3290c7..b0172283b7 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c
@@ -138,6 +138,7 @@ Ip4CancelFrameArp (
   @param[in]  CallBack  Call back function to execute if transmission
 finished.
   @param[in]  Context   Opaque parameter to the call back.
+  @param[in]  IpSb  The pointer to the IP4 service binding 
instance.
 
   @retval   Token   The wrapped token if succeed
   @retval   NULLThe wrapped token if NULL
@@ -149,7 +150,8 @@ Ip4WrapLinkTxToken (
   IN IP4_PROTOCOL   *IpInstance OPTIONAL,
   IN NET_BUF*Packet,

[edk2] [Patch 1/2] MdeModulePkg/Network: Add 32bit subnet mask support for IP4 PXE boot.

2018-08-27 Thread Fu Siyuan
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 
Cc: Ye Ting 
Cc: Wu Jiaxin 
---
 MdeModulePkg/Include/Library/NetLib.h |   5 +-
 MdeModulePkg/Library/DxeNetLib/DxeNetLib.c|  13 +-
 .../Universal/Network/Ip4Dxe/Ip4Common.h  |   2 +-
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c | 117 --
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h |   5 +-
 .../Universal/Network/Ip4Dxe/Ip4Impl.c|   2 +-
 .../Universal/Network/Ip4Dxe/Ip4Output.c  |  11 +-
 .../Universal/Network/Ip4Dxe/Ip4Route.c   |  21 +++-
 .../Universal/Network/Ip4Dxe/Ip4Route.h   |   5 +-
 .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c  |   6 +-
 10 files changed, 154 insertions(+), 33 deletions(-)

diff --git a/MdeModulePkg/Include/Library/NetLib.h 
b/MdeModulePkg/Include/Library/NetLib.h
index ef7bc429c1..b7ef99c7b5 100644
--- a/MdeModulePkg/Include/Library/NetLib.h
+++ b/MdeModulePkg/Include/Library/NetLib.h
@@ -422,8 +422,9 @@ NetGetIpClass (
 
   If all bits of the host address of IP are 0 or 1, IP is also not a valid 
unicast address,
   except when the originator is one of the endpoints of a point-to-point link 
with a 31-bit
-  mask (RFC3021).
-
+  mask (RFC3021), or a 32bit NetMask (all 0xFF) is used for special network 
environment (e.g.
+  PPP link).
+  
   @param[in]  IpThe IP to check against.
   @param[in]  NetMask   The mask of the IP.
 
diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c 
b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
index bf8f5523e6..63f4724062 100644
--- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
+++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
@@ -654,8 +654,9 @@ NetGetIpClass (
 
   If all bits of the host address of IP are 0 or 1, IP is also not a valid 
unicast address,
   except when the originator is one of the endpoints of a point-to-point link 
with a 31-bit
-  mask (RFC3021).
-
+  mask (RFC3021), or a 32bit NetMask (all 0xFF) is used for special network 
environment (e.g.
+  PPP link).
+  
   @param[in]  IpThe IP to check against.
   @param[in]  NetMask   The mask of the IP.
 
@@ -669,18 +670,20 @@ NetIp4IsUnicast (
   IN IP4_ADDR   NetMask
   )
 {
+  INTN   MaskLength;
+  
   ASSERT (NetMask != 0);
 
   if (Ip == 0 || IP4_IS_LOCAL_BROADCAST (Ip)) {
 return FALSE;
   }
 
-  if (NetGetMaskLength (NetMask) != 31) {
+  MaskLength = NetGetMaskLength (NetMask);
+  ASSERT ((MaskLength >= 0) && (MaskLength <= IP4_MASK_NUM));
+  if (MaskLength < 31) {
 if (((Ip &~NetMask) == ~NetMask) || ((Ip &~NetMask) == 0)) {
   return FALSE;
 }
-  } else {
-return TRUE;
   }
 
   return TRUE;
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h 
b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h
index e0fffc9d0d..994a81f4de 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h
@@ -55,7 +55,7 @@ typedef struct _IP4_SERVICEIP4_SERVICE;
 /// Compose the fragment field to be used in the IP4 header.
 ///
 #define IP4_HEAD_FRAGMENT_FIELD(Df, Mf, Offset) \
-((UINT16)(((Df) ? 0x4000 : 0) | ((Mf) ? 0x2000 : 0) | (((Offset) >> 3) & 
0x1fff)))
+((UINT16)(((Df) ? IP4_HEAD_DF_MASK : 0) | ((Mf) ? IP4_HEAD_MF_MASK : 0) | 
(((Offset) >> 3) & IP4_HEAD_OFFSET_MASK)))
 
 #define IP4_LAST_FRAGMENT(FragmentField)  \
   (((FragmentField) & IP4_HEAD_MF_MASK) == 0)
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c 
b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c
index 6e0e3290c7..b0172283b7 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c
@@ -138,6 +138,7 @@ Ip4CancelFrameArp (
   @param[in]  CallBack  Call back function to execute if transmission
 finished.
   @param[in]  Context   Opaque parameter to the call back.
+  @param[in]  IpSb  The pointer to the IP4 service binding 
instance.
 
   @retval   Token   The wrapped token if succeed
   @retval   NULLThe wrapped token if NULL
@@ -149,7 +150,8 @@ Ip4WrapLinkTxToken (
   IN IP4_PROTOCOL   *IpInstance OPTIONAL,
   IN NET_BUF*Packet,
   IN IP4_FRAME_CALLBACK CallBack,
-  IN VOID   *Context
+  IN VOID   *Context,
+  IN IP4_SERVICE*IpSb
   )
 {
   EFI_MANAGED_NETWORK_COMPLETION_TOKEN  *MnpToken;
@@ -170,6 +172,7 @@ Ip4WrapLinkTxToken (
 
   Token->Interface  = Interface;
   Token-&

[edk2] [Patch 0/2] Add 32bit subnet mask support for IP4 PXE

2018-08-27 Thread Fu Siyuan
Fu Siyuan (2):
  MdeModulePkg/Network: Add 32bit subnet mask support for IP4 PXE boot.
  ShellPkg: Update Ifconfig command to accept 32bit subnet mask.

 MdeModulePkg/Include/Library/NetLib.h |   5 +-
 MdeModulePkg/Library/DxeNetLib/DxeNetLib.c|  13 +-
 .../Universal/Network/Ip4Dxe/Ip4Common.h  |   2 +-
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c | 117 --
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h |   5 +-
 .../Universal/Network/Ip4Dxe/Ip4Impl.c|   2 +-
 .../Universal/Network/Ip4Dxe/Ip4Output.c  |  11 +-
 .../Universal/Network/Ip4Dxe/Ip4Route.c   |  21 +++-
 .../Universal/Network/Ip4Dxe/Ip4Route.h   |   5 +-
 .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c  |   6 +-
 .../UefiShellNetwork1CommandsLib/Ifconfig.c   |   1 +
 11 files changed, 155 insertions(+), 33 deletions(-)

-- 
2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch 2/2] ShellPkg: Update Ifconfig command to accept 32bit subnet mask.

2018-08-27 Thread Fu Siyuan
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
Cc: Ruiyu Ni 
Cc: Ye Ting 
Cc: Wu Jiaxin 
---
 ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c 
b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
index 52415e0ad0..e9f644c739 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
@@ -1032,6 +1032,7 @@ IfConfigSetInterfaceInfo (
   SubnetMask  = NTOHL (SubnetMask);
   TempGateway = NTOHL (TempGateway);
   if ((SubnetMask != 0) &&
+  (SubnetMask != 0xu) && 
   !NetIp4IsUnicast (TempGateway, SubnetMask)) {
 ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN 
(STR_IFCONFIG_INVALID_GATEWAY), gShellNetwork1HiiHandle, VarArg->Arg);
 ShellStatus = SHELL_INVALID_PARAMETER;
-- 
2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 1/2] MdeModulePkg/Network: Add 32bit subnet mask support for IP4 PXE boot.

2018-08-28 Thread Fu, Siyuan
Hi, Jiaxin

The "default route" means a route entry with zero SubnetAddress and zero 
SubnetMask, which will match all the dest address that can't match any other 
non-zero Subnet* route entry. 
The "instance route table" is a list of route entries which belong to an IP 
child instance.
The "default route table" is the route table used by these IP child instances 
with default IP address.
A default route (which is just one route entry) may belong to the default route 
table, or any instance route table.

The new function Ip4SendFrameToDefaultRoute() will always try to send the 
frames to the default entry, so the naming is correct. While how to determine 
the default route entry is not in this function, the Ip4Route() has been 
updated to handle the /32 subnet mask specially, and Ip4Output() will guarantee 
we check the instance route table first, then default route table (the code you 
quoted).

BestRegards
Fu Siyuan

> -Original Message-
> From: Wu, Jiaxin
> Sent: Tuesday, August 28, 2018 2:51 PM
> To: Fu, Siyuan ; edk2-devel@lists.01.org
> Cc: Ye, Ting 
> Subject: RE: [Patch 1/2] MdeModulePkg/Network: Add 32bit subnet mask
> support for IP4 PXE boot.
> 
> Hi Siyuan,
> 
> In Ip4SendFrameToDefaultRoute(), you tried to find the default gateway IP
> address by using the found RtCacheEntry->Tag, I'm confused why it's the
> default gateway? In my understanding, tag is the cache's corresponding
> route entry.  Besides, why we must send the frame to "DefaultRouter",
> should be the instance router first, then default router? If so, I suggest
> to rename the function to Ip4SendFrameToRoute(). Then, the logic in the
> function to retrieve the gateway should be:
> {
> if (IpInstance == NULL) {
>   CacheEntry = Ip4Route (IpSb->DefaultRouteTable, Head->Dst, Head->Src,
> IpIf->SubnetMask);
> } else {
>   CacheEntry = Ip4Route (IpInstance->RouteTable, Head->Dst, Head->Src,
> IpIf->SubnetMask);
>   if (CacheEntry == NULL) {
> CacheEntry = Ip4Route (IpSb->DefaultRouteTable, Head->Dst, Head-
> >Src, IpIf->SubnetMask);
>   }
> }
> 
> if (CacheEntry == NULL) {
>   return EFI_NOT_FOUND;
> }
> GateWay = CacheEntry->NextHop;
> Ip4FreeRouteCacheEntry (CacheEntry);
> }
> 
> What do you think?
> 
> Thanks,
> Jiaxin
> 
> 
> 
> 
> 
> 
> 
> 
> > -Original Message-
> > From: Fu, Siyuan
> > Sent: Tuesday, August 28, 2018 9:53 AM
> > To: edk2-devel@lists.01.org
> > Cc: Ye, Ting ; Wu, Jiaxin 
> > Subject: [Patch 1/2] MdeModulePkg/Network: Add 32bit subnet mask
> > support for IP4 PXE boot.
> >
> > 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 
> > Cc: Ye Ting 
> > Cc: Wu Jiaxin 
> > ---
> >  MdeModulePkg/Include/Library/NetLib.h |   5 +-
> >  MdeModulePkg/Library/DxeNetLib/DxeNetLib.c|  13 +-
> >  .../Universal/Network/Ip4Dxe/Ip4Common.h  |   2 +-
> >  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c | 117
> > --
> >  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h |   5 +-
> >  .../Universal/Network/Ip4Dxe/Ip4Impl.c|   2 +-
> >  .../Universal/Network/Ip4Dxe/Ip4Output.c  |  11 +-
> >  .../Universal/Network/Ip4Dxe/Ip4Route.c   |  21 +++-
> >  .../Universal/Network/Ip4Dxe/Ip4Route.h   |   5 +-
> >  .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c  |   6 +-
> >  10 files changed, 154 insertions(+), 33 deletions(-)
> >
> > diff --git a/MdeModulePkg/Include/Library/NetLib.h
> > b/MdeModulePkg/Include/Library/NetLib.h
> > index ef7bc429c1..b7ef99c7b5 100644
> > --- a/MdeModulePkg/Include/Library/NetLib.h
> > +++ b/MdeModulePkg/Include/Library/NetLib.h
> > @@ -422,8 +422,9 @@ NetGetIpClass (
> >
> >If all bits of the host address of IP are 0 or 1, IP is also not a
> valid unicast
> > address,
> >except when the originator is one of the endpoints of a point-to-
> point link
> > with a 31-bit
> > -  mask (RFC3021).
> > -
> > +  mask (RFC3021), or a 32bit NetMask (all 0xFF) is used for special
> network
> > environment (e.g.
> > +  PPP link).

Re: [edk2] [PATCH] MdeModulePkg: Remove trailing white space

2018-09-04 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan 

> -Original Message-
> From: Zeng, Star
> Sent: Wednesday, September 5, 2018 10:01 AM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star ; Bi, Dandan ;
> Gao, Liming ; Wang, Jian J ;
> Fu, Siyuan ; Wu, Jiaxin 
> Subject: [PATCH] MdeModulePkg: Remove trailing white space
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1144
> 
> Cc: Dandan Bi 
> Cc: Liming Gao 
> Cc: Jian J Wang 
> Cc: Siyuan Fu 
> Cc: Jiaxin Wu 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng 
> ---
>  MdeModulePkg/Core/Pei/Ppi/Ppi.c|  4 +--
>  MdeModulePkg/Include/Library/NetLib.h  |  2 +-
>  .../Library/DxeCapsuleLibFmp/DxeCapsuleLib.c   |  2 +-
>  MdeModulePkg/Library/DxeNetLib/DxeNetLib.c |  4 +--
>  MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c|  2 +-
>  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c  | 14 +-
>  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c| 30 +++--
> -
>  7 files changed, 29 insertions(+), 29 deletions(-)
> 
> diff --git a/MdeModulePkg/Core/Pei/Ppi/Ppi.c
> b/MdeModulePkg/Core/Pei/Ppi/Ppi.c
> index d8ba2dd42b59..6f03858b8a94 100644
> --- a/MdeModulePkg/Core/Pei/Ppi/Ppi.c
> +++ b/MdeModulePkg/Core/Pei/Ppi/Ppi.c
> @@ -143,7 +143,7 @@ ConvertPointerInRanges (
> 
>Migrate Single PPI Pointer from the temporary memory to PEI installed
> memory.
> 
> -  @param SecCoreData Points to a data structure containing SEC to PEI
> handoff data, such as the size
> +  @param SecCoreData Points to a data structure containing SEC to PEI
> handoff data, such as the size
>   and location of temporary RAM, the stack
> location and the BFV location.
>@param PrivateData Pointer to PeiCore's private data structure.
>@param PpiPointer  Pointer to Ppi
> @@ -179,7 +179,7 @@ ConvertSinglePpiPointer (
> 
>Migrate PPI Pointers from the temporary memory to PEI installed memory.
> 
> -  @param SecCoreData Points to a data structure containing SEC to PEI
> handoff data, such as the size
> +  @param SecCoreData Points to a data structure containing SEC to PEI
> handoff data, such as the size
>   and location of temporary RAM, the stack
> location and the BFV location.
>@param PrivateData Pointer to PeiCore's private data structure.
> 
> diff --git a/MdeModulePkg/Include/Library/NetLib.h
> b/MdeModulePkg/Include/Library/NetLib.h
> index b7ef99c7b568..09779739213e 100644
> --- a/MdeModulePkg/Include/Library/NetLib.h
> +++ b/MdeModulePkg/Include/Library/NetLib.h
> @@ -424,7 +424,7 @@ NetGetIpClass (
>except when the originator is one of the endpoints of a point-to-point
> link with a 31-bit
>mask (RFC3021), or a 32bit NetMask (all 0xFF) is used for special
> network environment (e.g.
>PPP link).
> -
> +
>@param[in]  IpThe IP to check against.
>@param[in]  NetMask   The mask of the IP.
> 
> diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
> b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
> index 91c6849a4658..20fd29a3a87f 100644
> --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
> +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
> @@ -765,7 +765,7 @@ GetFmpHandleBufferByType (
>  MatchedHandleBuffer[MatchedNumberOfHandles] =
> HandleBuffer[Index];
>}
>if (MatchedResetRequiredBuffer != NULL) {
> -MatchedResetRequiredBuffer[MatchedNumberOfHandles] =
> (((TempFmpImageInfo->AttributesSupported &
> +MatchedResetRequiredBuffer[MatchedNumberOfHandles] =
> (((TempFmpImageInfo->AttributesSupported &
> 
> IMAGE_ATTRIBUTE_RESET_REQUIRED) != 0) &&
> 
> ((TempFmpImageInfo->AttributesSetting &
> 
> IMAGE_ATTRIBUTE_RESET_REQUIRED) != 0));
> diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
> b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
> index 63f4724062e9..9e3ea2490928 100644
> --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
> +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
> @@ -656,7 +656,7 @@ NetGetIpClass (
>except when the originator is one of the endpoints of a point-to-point
> link with a 31-bit
>mask (RFC3021), or a 32bit NetMask (all 0xFF) is used for special
> network environment (e.g.
>PPP link).
> -
> +
>@param[in]  IpThe IP to check against.
>@param[in]  NetMask   The mask of the IP.
> 
> @@ -671,7 +671,7 @@ NetIp4IsUnicast (
>)
>  {
>INTN   MaskLength;
> -
> +
>ASSERT (NetMask != 0);
> 
>if

[edk2] [Patch] ShellPkg: Remove trailing white space

2018-09-07 Thread Fu Siyuan
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1158

Cc: Ruiyu Ni 
Cc: Jaben Carsey 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---
 ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c 
b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
index e9f644c739..cdc6db69c3 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
@@ -1032,7 +1032,7 @@ IfConfigSetInterfaceInfo (
   SubnetMask  = NTOHL (SubnetMask);
   TempGateway = NTOHL (TempGateway);
   if ((SubnetMask != 0) &&
-  (SubnetMask != 0xu) && 
+  (SubnetMask != 0xu) &&
   !NetIp4IsUnicast (TempGateway, SubnetMask)) {
 ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN 
(STR_IFCONFIG_INVALID_GATEWAY), gShellNetwork1HiiHandle, VarArg->Arg);
 ShellStatus = SHELL_INVALID_PARAMETER;
-- 
2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch v2] MdeModulePkg/Ip4Dxe: Sync the direct route entry setting.

2018-09-12 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan 

> -Original Message-
> From: Wu, Jiaxin
> Sent: Tuesday, September 4, 2018 3:38 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting ; Fu, Siyuan ; Wu,
> Jiaxin 
> Subject: [Patch v2] MdeModulePkg/Ip4Dxe: Sync the direct route entry
> setting.
> 
> 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 
> Cc: Fu Siyuan 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Wu Jiaxin 
> Reviewed-by: Ye Ting 
> ---
>  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c |  7 ---
>  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c| 10 +++---
>  2 files changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
> b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
> index c19a72730e..b52542cd84 100644
> --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
> +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
> @@ -557,17 +557,10 @@ Ip4Config2SetDefaultAddr (
>  return Status;
>}
>  }
>}
> 
> -  Ip4AddRoute (
> -IpSb->DefaultRouteTable,
> -StationAddress,
> -SubnetMask,
> -IP4_ALLZERO_ADDRESS
> -);
> -
>//
>// Add a route for the connected network.
>//
>Subnet = StationAddress & SubnetMask;
> 
> diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
> b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
> index 6a26143e30..13ebeab1be 100644
> --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
> +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
> @@ -670,14 +670,18 @@ Ip4ConfigProtocol (
> 
>InsertTailList (>Interfaces, >Link);
>  }
> 
>  //
> -// Add a route to this connected network in the route table
> +// Add a route to this connected network in the instance route table.
>  //
> -Ip4AddRoute (IpInstance->RouteTable, Ip, Netmask,
> IP4_ALLZERO_ADDRESS);
> -
> +Ip4AddRoute (
> +  IpInstance->RouteTable,
> +  Ip & Netmask,
> +  Netmask,
> +  IP4_ALLZERO_ADDRESS
> +  );
>} else {
>  //
>  // Use the default address. Check the state.
>  //
>  if (IpSb->State == IP4_SERVICE_UNSTARTED) {
> --
> 2.17.1.windows.2

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] MdeModulePkg/Mtftp4Dxe: Fix the incorrect return status.

2018-03-12 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>

> -Original Message-
> From: Wu, Jiaxin
> Sent: Monday, March 12, 2018 10:22 AM
> To: edk2-devel@lists.01.org
> Cc: Wang, Fan <fan.w...@intel.com>; Fu, Siyuan <siyuan...@intel.com>; Ye,
> Ting <ting...@intel.com>
> Subject: [Patch] MdeModulePkg/Mtftp4Dxe: Fix the incorrect return status.
> 
> 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.w...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu <jiaxin...@intel.com>
> ---
>  .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c   | 22 +++--
> -
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> index d8c48ec8b2..065528c937 100644
> --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> @@ -364,10 +364,11 @@ Mtftp4Start (
>MTFTP4_PROTOCOL   *Instance;
>EFI_MTFTP4_OVERRIDE_DATA  *Override;
>EFI_MTFTP4_CONFIG_DATA*Config;
>EFI_TPL   OldTpl;
>EFI_STATUSStatus;
> +  EFI_STATUSTokenStatus;
> 
>//
>// Validate the parameters
>//
>if ((This == NULL) || (Token == NULL) || (Token->Filename == NULL) ||
> @@ -391,28 +392,28 @@ Mtftp4Start (
>  return EFI_INVALID_PARAMETER;
>}
> 
>Instance = MTFTP4_PROTOCOL_FROM_THIS (This);
> 
> -  Status = EFI_SUCCESS;
> +  Status  = EFI_SUCCESS;
> +  TokenStatus = EFI_SUCCESS;
> +
>OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
> 
>if (Instance->State != MTFTP4_STATE_CONFIGED) {
>  Status = EFI_NOT_STARTED;
>}
> 
>if (Instance->Operation != 0) {
>  Status = EFI_ACCESS_DENIED;
>}
> 
> -  if (EFI_ERROR (Status)) {
> -gBS->RestoreTPL (OldTpl);
> -return Status;
> -  }
> -
>if ((Token->OverrideData != NULL) && !Mtftp4OverrideValid (Instance,
> Token->OverrideData)) {
>  Status = EFI_INVALID_PARAMETER;
> +  }
> +
> +  if (EFI_ERROR (Status)) {
>  gBS->RestoreTPL (OldTpl);
>  return Status;
>}
> 
>//
> @@ -429,11 +430,11 @@ Mtftp4Start (
> TRUE,
> >RequestOption
> );
> 
>  if (EFI_ERROR (Status)) {
> -  Status = EFI_DEVICE_ERROR;
> +  TokenStatus = EFI_DEVICE_ERROR;
>goto ON_ERROR;
>  }
>}
> 
>//
> @@ -482,13 +483,12 @@ Mtftp4Start (
> 
>//
>// Config the unicast UDP child to send initial request
>//
>Status = Mtftp4ConfigUnicastPort (Instance->UnicastPort, Instance);
> -
>if (EFI_ERROR (Status)) {
> -Status = EFI_DEVICE_ERROR;
> +TokenStatus = EFI_DEVICE_ERROR;
>  goto ON_ERROR;
>}
> 
>//
>// Set initial status.
> @@ -503,11 +503,11 @@ Mtftp4Start (
>} else {
>  Status = Mtftp4RrqStart (Instance, Operation);
>}
> 
>if (EFI_ERROR (Status)) {
> -Status = EFI_DEVICE_ERROR;
> +TokenStatus = EFI_DEVICE_ERROR;
>  goto ON_ERROR;
>}
> 
>if (Token->Event != NULL) {
>  gBS->RestoreTPL (OldTpl);
> @@ -524,11 +524,11 @@ Mtftp4Start (
> 
>gBS->RestoreTPL (OldTpl);
>return Token->Status;
> 
>  ON_ERROR:
> -  Mtftp4CleanOperation (Instance, Status);
> +  Mtftp4CleanOperation (Instance, TokenStatus);
>gBS->RestoreTPL (OldTpl);
> 
>return Status;
>  }
> 
> --
> 2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] NetworkPkg/HttpBootDxe: Fix the incorrect error message output.

2018-02-28 Thread Fu, Siyuan


Reviewed-by: Fu Siyuan <siyuan...@intel.com>



> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jiaxin Wu
> Sent: Thursday, March 1, 2018 2:30 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting...@intel.com>; Fu, Siyuan <siyuan...@intel.com>; Wu,
> Jiaxin <jiaxin...@intel.com>
> Subject: [edk2] [Patch] NetworkPkg/HttpBootDxe: Fix the incorrect error
> message output.
> 
> 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...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
> ---
>  NetworkPkg/HttpBootDxe/HttpBootClient.c |  1 +
>  NetworkPkg/HttpBootDxe/HttpBootImpl.c   | 37 ++--
> -
>  2 files changed, 21 insertions(+), 17 deletions(-)
> 
> diff --git a/NetworkPkg/HttpBootDxe/HttpBootClient.c
> b/NetworkPkg/HttpBootDxe/HttpBootClient.c
> index b93e63bb2f..1d1e47008d 100644
> --- a/NetworkPkg/HttpBootDxe/HttpBootClient.c
> +++ b/NetworkPkg/HttpBootDxe/HttpBootClient.c
> @@ -472,10 +472,11 @@ HttpBootDhcp6ExtractUriInfo (
>  }
> 
>  Status = HttpBootDns (Private, HostNameStr, );
>  FreePool (HostNameStr);
>  if (EFI_ERROR (Status)) {
> +  AsciiPrint ("\n  Error: Could not retrieve the host address from
> DNS server.\n");
>goto Error;
>  }
>}
> 
>CopyMem (>ServerIp.v6, , sizeof (EFI_IPv6_ADDRESS));
> diff --git a/NetworkPkg/HttpBootDxe/HttpBootImpl.c
> b/NetworkPkg/HttpBootDxe/HttpBootImpl.c
> index 16c1207bf8..a0fd934ec4 100644
> --- a/NetworkPkg/HttpBootDxe/HttpBootImpl.c
> +++ b/NetworkPkg/HttpBootDxe/HttpBootImpl.c
> @@ -1,9 +1,9 @@
>  /** @file
>The implementation of EFI_LOAD_FILE_PROTOCOL for UEFI HTTP boot.
> 
> -Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
> +Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
>  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
>  This program and the accompanying materials are licensed and made
> available under
>  the terms and conditions of the BSD License that accompanies this
> distribution.
>  The full text of the license may be found at
>  http://opensource.org/licenses/bsd-license.php.
> @@ -329,11 +329,11 @@ HttpBootLoadFile (
>  //
>  // Parse the cached offer to get the boot file URL first.
>  //
>  Status = HttpBootDiscoverBootInfo (Private);
>  if (EFI_ERROR (Status)) {
> -  AsciiPrint ("\n  Error: Could not discover the boot information for
> DHCP server.\n");
> +  AsciiPrint ("\n  Error: Could not retrieve NBP file size from HTTP
> server.\n");
>goto ON_EXIT;
>  }
>}
> 
>if (!Private->HttpCreated) {
> @@ -398,26 +398,29 @@ HttpBootLoadFile (
>   ImageType
>   );
> 
>  ON_EXIT:
>HttpBootUninstallCallback (Private);
> -
> -  if (Status == EFI_ACCESS_DENIED) {
> -AsciiPrint ("\n  Error: Could not establish connection with HTTP
> server.\n");
> -  } else if (Status == EFI_BUFFER_TOO_SMALL && Buffer != NULL) {
> -AsciiPrint ("\n  Error: Buffer size is smaller than the requested
> file.\n");
> -  } else if (Status == EFI_OUT_OF_RESOURCES) {
> -AsciiPrint ("\n  Error: Could not allocate I/O buffers.\n");
> -  } else if (Status == EFI_DEVICE_ERROR) {
> -AsciiPrint ("\n  Error: Network device error.\n");
> -  } else if (Status == EFI_TIMEOUT) {
> -AsciiPrint ("\n  Error: Server response timeout.\n");
> -  } else if (Status == EFI_ABORTED) {
> -AsciiPrint ("\n  Error: Remote boot cancelled.\n");
> -  } else if (Status != EFI_BUFFER_TOO_SMALL) {
> -AsciiPrint ("\n  Error: Unexpected network error.\n");
> +
> +  if (EFI_ERROR (Status)) {
> +if (Status == EFI_ACCESS_DENIED) {
> +  AsciiPrint ("\n  Error: Could not establish connection with HTTP
> server.\n");
> +} else if (Status 

Re: [edk2] [Patch] NetworkPkg/HttpBootDxe: Correct the parameter check for the usage of HttpBootGetFileFromCache.

2018-02-28 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jiaxin Wu
> Sent: Thursday, March 1, 2018 2:30 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting...@intel.com>; Fu, Siyuan <siyuan...@intel.com>; Wu,
> Jiaxin <jiaxin...@intel.com>
> Subject: [edk2] [Patch] NetworkPkg/HttpBootDxe: Correct the parameter
> check for the usage of HttpBootGetFileFromCache.
> 
> The patch is to fix the incorrect parameter check for the
> HttpBootGetFileFromCache().
> 
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
> ---
>  NetworkPkg/HttpBootDxe/HttpBootClient.c | 13 ++---
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/NetworkPkg/HttpBootDxe/HttpBootClient.c
> b/NetworkPkg/HttpBootDxe/HttpBootClient.c
> index 15e0ab9d69..b93e63bb2f 100644
> --- a/NetworkPkg/HttpBootDxe/HttpBootClient.c
> +++ b/NetworkPkg/HttpBootDxe/HttpBootClient.c
> @@ -1,9 +1,9 @@
>  /** @file
>Implementation of the boot file download function.
> 
> -Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
> +Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
>  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
>  This program and the accompanying materials are licensed and made
> available under
>  the terms and conditions of the BSD License that accompanies this
> distribution.
>  The full text of the license may be found at
>  http://opensource.org/licenses/bsd-license.php.
> @@ -434,11 +434,11 @@ HttpBootDhcp6ExtractUriInfo (
>goto Error;
>  }
>}
> 
>//
> -  // Extract the HTTP server Ip frome URL. This is used to Check route
> table
> +  // Extract the HTTP server Ip from URL. This is used to Check route
> table
>// whether can send message to HTTP Server Ip through the GateWay.
>//
>Status = HttpUrlGetIp6 (
>   Private->BootFileUri,
>   Private->BootFileUriParser,
> @@ -744,23 +744,22 @@ HttpBootGetFileFromCache (
>LIST_ENTRY  *Entry2;
>HTTP_BOOT_CACHE_CONTENT *Cache;
>HTTP_BOOT_ENTITY_DATA   *EntityData;
>UINTN   CopyedSize;
> 
> -  if (Uri == NULL || BufferSize == 0 || Buffer == NULL || ImageType ==
> NULL) {
> +  if (Uri == NULL || BufferSize == NULL || Buffer == NULL || ImageType ==
> NULL) {
>  return EFI_INVALID_PARAMETER;
>}
> 
>NET_LIST_FOR_EACH (Entry, >CacheList) {
>  Cache = NET_LIST_USER_STRUCT (Entry, HTTP_BOOT_CACHE_CONTENT, Link);
>  //
>  // Compare the URI to see whether we already have a cache for this
> file.
>  //
>  if ((Cache->RequestData != NULL) &&
>  (Cache->RequestData->Url != NULL) &&
> -(StrCmp (Uri, Cache->RequestData->Url) == 0))
> -{
> +(StrCmp (Uri, Cache->RequestData->Url) == 0)) {
>//
>// Hit in cache, record image type.
>//
>*ImageType  = Cache->ImageType;
> 
> @@ -945,11 +944,11 @@ HttpBootGetBootFile (
>Url = AllocatePool (UrlSize * sizeof (CHAR16));
>if (Url == NULL) {
>  return EFI_OUT_OF_RESOURCES;
>}
>AsciiStrToUnicodeStrS (Private->BootFileUri, Url, UrlSize);
> -  if (!HeaderOnly) {
> +  if (!HeaderOnly && Buffer != NULL) {
>  Status = HttpBootGetFileFromCache (Private, Url, BufferSize, Buffer,
> ImageType);
>  if (Status != EFI_NOT_FOUND) {
>FreePool (Url);
>return Status;
>  }
> @@ -1127,11 +1126,11 @@ HttpBootGetBootFile (
>Context.Buffer = Buffer;
>Context.BufferSize = *BufferSize;
>Context.Cache  = Cache;
>Context.Private= Private;
>Status = HttpInitMsgParser (
> - HeaderOnly? HttpMethodHead : HttpMethodGet,
> + HeaderOnly ? HttpMethodHead : HttpMethodGet,
>   ResponseData->Response.StatusCode,
>   ResponseData->HeaderCount,
>   ResponseData->Headers,
>   HttpBootGetBootFileCallback,
>   (VOID*) ,
> --
> 2.16.2.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] NetworkPkg/Udp6Dxe: Fix the failure to leave one multicast group address.

2018-03-01 Thread Fu, Siyuan


Reviewed-by: Fu Siyuan <siyuan...@intel.com>



> -Original Message-
> From: Wu, Jiaxin
> Sent: Thursday, March 1, 2018 5:38 PM
> To: edk2-devel@lists.01.org
> Cc: Wang, Fan <fan.w...@intel.com>; Fu, Siyuan <siyuan...@intel.com>; Ye,
> Ting <ting...@intel.com>
> Subject: [Patch] NetworkPkg/Udp6Dxe: Fix the failure to leave one
> multicast group address.
> 
> 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.w...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu <jiaxin...@intel.com>
> ---
>  NetworkPkg/Udp6Dxe/Udp6Main.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/NetworkPkg/Udp6Dxe/Udp6Main.c b/NetworkPkg/Udp6Dxe/Udp6Main.c
> index 1d7f0acbc7..e9d94dd00c 100644
> --- a/NetworkPkg/Udp6Dxe/Udp6Main.c
> +++ b/NetworkPkg/Udp6Dxe/Udp6Main.c
> @@ -380,10 +380,13 @@ Udp6Groups (
> 
>  Status = NetMapInsertTail (>McastIps, (VOID *) McastIp,
> NULL);
>} else {
> 
>  Status = NetMapIterate (>McastIps, Udp6LeaveGroup,
> MulticastAddress);
> +if ((MulticastAddress != NULL) && (Status == EFI_ABORTED)) {
> +  Status = EFI_SUCCESS;
> +}
>}
> 
>  ON_EXIT:
> 
>gBS->RestoreTPL (OldTpl);
> --
> 2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the poll function.

2018-03-01 Thread Fu, Siyuan
Hi, Jiaxin

Do you mean the code which calls MTFTP4->Poll() at TPL_CALLBACK will cause 
system hang? This should not happen because all network protocol should be able 
to run at TPL_CALLBACK.

BestRegards
Fu Siyuan


> -Original Message-
> From: Wu, Jiaxin
> Sent: Thursday, March 1, 2018 5:38 PM
> To: edk2-devel@lists.01.org
> Cc: Wang, Fan <fan.w...@intel.com>; Fu, Siyuan <siyuan...@intel.com>; Ye,
> Ting <ting...@intel.com>
> Subject: [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the poll
> function.
> 
> This patch is to fix the hang issue, which was enrolled by the commit of
> 39b0867d.
> The TPL should be restored before calling poll function at TPL_CALLBACK.
> 
> Cc: Wang Fan <fan.w...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu <jiaxin...@intel.com>
> ---
>  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> index f5f9e6d8f7..64e0463dd9 100644
> --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> @@ -507,24 +507,27 @@ Mtftp4Start (
>if (EFI_ERROR (Status)) {
>  Status = EFI_DEVICE_ERROR;
>  goto ON_ERROR;
>}
> 
> +  //
> +  // Restore the TPL now, don't call poll function at TPL_CALLBACK.
> +  //
> +  gBS->RestoreTPL (OldTpl);
> +
>if (Token->Event != NULL) {
> -gBS->RestoreTPL (OldTpl);
>  return EFI_SUCCESS;
>}
> 
>//
>// Return immediately for asynchronous operation or poll the
>// instance for synchronous operation.
>//
>while (Token->Status == EFI_NOT_READY) {
>  This->Poll (This);
>}
> -
> -  gBS->RestoreTPL (OldTpl);
> +
>return Token->Status;
> 
>  ON_ERROR:
>Mtftp4CleanOperation (Instance, Status);
>gBS->RestoreTPL (OldTpl);
> --
> 2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 1/2] NetworkPkg/IScsiDxe: Fix the ISCSI connection failure in certain case.

2018-03-12 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>


> -Original Message-
> From: Wu, Jiaxin
> Sent: Monday, March 12, 2018 4:31 PM
> To: edk2-devel@lists.01.org
> Cc: Fu, Siyuan <siyuan...@intel.com>; Ye, Ting <ting...@intel.com>
> Subject: [Patch 1/2] NetworkPkg/IScsiDxe: Fix the ISCSI connection failure
> in certain case.
> 
> 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...@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu <jiaxin...@intel.com>
> ---
>  NetworkPkg/IScsiDxe/IScsiMisc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c
> b/NetworkPkg/IScsiDxe/IScsiMisc.c
> index 94f3725866..745b7ac07b 100644
> --- a/NetworkPkg/IScsiDxe/IScsiMisc.c
> +++ b/NetworkPkg/IScsiDxe/IScsiMisc.c
> @@ -1982,11 +1982,11 @@ IScsiDnsIsConfigured (
>  if (AttemptTmp->SessionConfigData.Enabled == ISCSI_DISABLED || StrCmp
> (MacString, AttemptMacString)) {
>FreePool (AttemptTmp);
>continue;
>  }
> 
> -if (AttemptTmp->SessionConfigData.DnsMode) {
> +if (AttemptTmp->SessionConfigData.DnsMode || AttemptTmp-
> >SessionConfigData.TargetInfoFromDhcp) {
>FreePool (AttemptTmp);
>FreePool (AttemptConfigOrder);
>return TRUE;
>  } else {
>FreePool (AttemptTmp);
> --
> 2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 02/13] MdePkg/Include/Protocol/Tls.h: pack structures from the TLS RFC

2018-04-09 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>

> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Tuesday, April 3, 2018 10:52 PM
> To: edk2-devel-01 <edk2-devel@lists.01.org>
> Cc: Wu, Jiaxin <jiaxin...@intel.com>; Gao, Liming <liming@intel.com>;
> Kinney, Michael D <michael.d.kin...@intel.com>; Fu, Siyuan
> <siyuan...@intel.com>
> Subject: [PATCH 02/13] MdePkg/Include/Protocol/Tls.h: pack structures from
> the TLS RFC
> 
> The structures defined in RFC 5246 are not to have any padding between
> fields or at the end; use the "pack" pragma as necessary.
> 
> Cc: Jiaxin Wu <jiaxin...@intel.com>
> Cc: Liming Gao <liming@intel.com>
> Cc: Michael D Kinney <michael.d.kin...@intel.com>
> Cc: Siyuan Fu <siyuan...@intel.com>
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=915
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Laszlo Ersek <ler...@redhat.com>
> ---
>  MdePkg/Include/Protocol/Tls.h | 10 ++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/MdePkg/Include/Protocol/Tls.h b/MdePkg/Include/Protocol/Tls.h
> index 2119f33c0f5b..dafaabcd2a8b 100644
> --- a/MdePkg/Include/Protocol/Tls.h
> +++ b/MdePkg/Include/Protocol/Tls.h
> @@ -138,33 +138,37 @@ typedef enum {
>  ///
>  /// EFI_TLS_CIPHER
>  /// Note: The definition of EFI_TLS_CIPHER definition is from "RFC 5246,
> A.4.1.
>  ///   Hello Messages". The value of EFI_TLS_CIPHER is from TLS Cipher
>  ///   Suite Registry of IANA.
>  ///
> +#pragma pack (1)
>  typedef struct {
>UINT8 Data1;
>UINT8 Data2;
>  } EFI_TLS_CIPHER;
> +#pragma pack ()
> 
>  ///
>  /// EFI_TLS_COMPRESSION
>  /// Note: The value of EFI_TLS_COMPRESSION definition is from "RFC 3749".
>  ///
>  typedef UINT8 EFI_TLS_COMPRESSION;
> 
>  ///
>  /// EFI_TLS_EXTENSION
>  /// Note: The definition of EFI_TLS_EXTENSION if from "RFC 5246 A.4.1.
>  ///   Hello Messages".
>  ///
> +#pragma pack (1)
>  typedef struct {
>UINT16ExtensionType;
>UINT16Length;
>UINT8 Data[1];
>  } EFI_TLS_EXTENSION;
> +#pragma pack ()
> 
>  ///
>  /// EFI_TLS_VERIFY
>  /// Use either EFI_TLS_VERIFY_NONE or EFI_TLS_VERIFY_PEER, the last two
> options
>  /// are 'ORed' with EFI_TLS_VERIFY_PEER if they are desired.
>  ///
> @@ -191,35 +195,41 @@ typedef UINT32  EFI_TLS_VERIFY;
> 
>  ///
>  /// EFI_TLS_RANDOM
>  /// Note: The definition of EFI_TLS_RANDOM is from "RFC 5246 A.4.1.
>  ///   Hello Messages".
>  ///
> +#pragma pack (1)
>  typedef struct {
>UINT32GmtUnixTime;
>UINT8 RandomBytes[28];
>  } EFI_TLS_RANDOM;
> +#pragma pack ()
> 
>  ///
>  /// EFI_TLS_MASTER_SECRET
>  /// Note: The definition of EFI_TLS_MASTER_SECRET is from "RFC 5246 8.1.
>  ///   Computing the Master Secret".
>  ///
> +#pragma pack (1)
>  typedef struct {
>UINT8 Data[48];
>  } EFI_TLS_MASTER_SECRET;
> +#pragma pack ()
> 
>  ///
>  /// EFI_TLS_SESSION_ID
>  /// Note: The definition of EFI_TLS_SESSION_ID is from "RFC 5246 A.4.1.
> Hello Messages".
>  ///
>  #define MAX_TLS_SESSION_ID_LENGTH  32
> +#pragma pack (1)
>  typedef struct {
>UINT16Length;
>UINT8 Data[MAX_TLS_SESSION_ID_LENGTH];
>  } EFI_TLS_SESSION_ID;
> +#pragma pack ()
> 
>  ///
>  /// EFI_TLS_SESSION_STATE
>  ///
>  typedef enum {
>///
> --
> 2.14.1.3.gb7cf6e02401b
> 

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 03/13] NetworkPkg/TlsDxe: verify DataSize for EfiTlsCipherList

2018-04-09 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>



> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Tuesday, April 3, 2018 10:52 PM
> To: edk2-devel-01 <edk2-devel@lists.01.org>
> Cc: Wu, Jiaxin <jiaxin...@intel.com>; Fu, Siyuan <siyuan...@intel.com>
> Subject: [PATCH 03/13] NetworkPkg/TlsDxe: verify DataSize for
> EfiTlsCipherList
> 
> 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...@intel.com>
> Cc: Siyuan Fu <siyuan...@intel.com>
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=915
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Laszlo Ersek <ler...@redhat.com>
> ---
>  NetworkPkg/TlsDxe/TlsProtocol.c | 12 ++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/NetworkPkg/TlsDxe/TlsProtocol.c
> b/NetworkPkg/TlsDxe/TlsProtocol.c
> index ad4c922c60bd..a5f95a098345 100644
> --- a/NetworkPkg/TlsDxe/TlsProtocol.c
> +++ b/NetworkPkg/TlsDxe/TlsProtocol.c
> @@ -35,12 +35,13 @@ EFI_TLS_PROTOCOL  mTlsProtocol = {
> 
>@retval EFI_SUCCESS The TLS session data is set
> successfully.
>@retval EFI_INVALID_PARAMETER   One or more of the following conditions
> is TRUE:
>This is NULL.
>Data is NULL.
>DataSize is 0.
> +  DataSize is invalid for DataType.
>@retval EFI_UNSUPPORTED The DataType is unsupported.
>@retval EFI_ACCESS_DENIED   If the DataType is one of below:
>EfiTlsClientRandom
>EfiTlsServerRandom
>EfiTlsKeyMaterial
>@retval EFI_NOT_READY   Current TLS session state is NOT
> @@ -56,12 +57,13 @@ TlsSetSessionData (
>IN UINTN DataSize
>)
>  {
>EFI_STATUSStatus;
>TLS_INSTANCE  *Instance;
>UINT16*CipherId;
> +  UINTN CipherCount;
>UINTN Index;
> 
>EFI_TPL   OldTpl;
> 
>Status = EFI_SUCCESS;
>CipherId = NULL;
> @@ -97,23 +99,29 @@ TlsSetSessionData (
>goto ON_EXIT;
>  }
> 
>  Status = TlsSetConnectionEnd (Instance->TlsConn,
> *((EFI_TLS_CONNECTION_END *) Data));
>  break;
>case EfiTlsCipherList:
> +if (DataSize % sizeof (EFI_TLS_CIPHER) != 0) {
> +  Status = EFI_INVALID_PARAMETER;
> +  goto ON_EXIT;
> +}
> +
>  CipherId = AllocatePool (DataSize);
>  if (CipherId == NULL) {
>Status = EFI_OUT_OF_RESOURCES;
>goto ON_EXIT;
>  }
> 
> -for (Index = 0; Index < DataSize / sizeof (EFI_TLS_CIPHER); Index++)
> {
> +CipherCount = DataSize / sizeof (EFI_TLS_CIPHER);
> +for (Index = 0; Index < CipherCount; Index++) {
>*(CipherId +Index) = HTONS (*(((UINT16 *) Data) + Index));
>  }
> 
> -Status = TlsSetCipherList (Instance->TlsConn, CipherId, DataSize /
> sizeof (EFI_TLS_CIPHER));
> +Status = TlsSetCipherList (Instance->TlsConn, CipherId, CipherCount);
> 
>  FreePool (CipherId);
>  break;
>case EfiTlsCompressionMethod:
>  //
>  // TLS seems only define one CompressionMethod.null, which specifies
> that data exchanged via the
> --
> 2.14.1.3.gb7cf6e02401b
> 

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 0/5] NetworkPkg: HTTP and TLS updates

2018-03-27 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>


> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Thursday, March 22, 2018 9:39 AM
> To: edk2-devel-01 <edk2-devel@lists.01.org>
> Cc: Wu, Jiaxin <jiaxin...@intel.com>; Fu, Siyuan <siyuan...@intel.com>
> Subject: [PATCH 0/5] NetworkPkg: HTTP and TLS updates
> 
> Repo:   https://github.com/lersek/edk2.git
> Branch: http_and_tls_updates
> 
> Patch #4 fixes TianoCore BZ#909
> <https://bugzilla.tianocore.org/show_bug.cgi?id=909>.
> 
> Patches #2 and #3 are cleanups / preparation for patch #4.
> 
> Patch #1 fixes an independent typo that I noticed in the code while
> configuring my DHCP server for HTTP(S) booting. It's isolated, so I put
> it first in the series.
> 
> Patch #5 is preparation for future platform enablement, so that a
> platform can create both "TlsCaCertificate" and "HttpTlsCipherList"
> variables on every boot from scratch as volatile variables (without
> flash varstore footprint).
> 
> I regression-tested this series with a successful HTTPS boot of an ISO
> image from OVMF, using a DER-formatted self-signed certificate that I
> enrolled with TlsAuthConfigDxe.
> 
> Cc: Jiaxin Wu <jiaxin...@intel.com>
> Cc: Siyuan Fu <siyuan...@intel.com>
> 
> Thanks,
> Laszlo
> 
> Laszlo Ersek (5):
>   NetworkPkg/HttpBootDxe: fix typo in DHCPv4 packet parsing
>   NetworkPkg/HttpDxe: use error handler epilogue in
> TlsConfigCertificate()
>   NetworkPkg/HttpDxe: drop misleading comment / status code in cert
> config
>   NetworkPkg/HttpDxe: sanity-check the TlsCaCertificate variable before
> use
>   NetworkPkg/TlsAuthConfigDxe: preserve TlsCaCertificate variable
> attributes
> 
>  NetworkPkg/HttpBootDxe/HttpBootDhcp4.c  |  4 +-
>  NetworkPkg/HttpDxe/HttpDxe.inf  |  3 +-
>  NetworkPkg/HttpDxe/HttpsSupport.c   | 74 ++--
>  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c | 15 ++--
>  4 files changed, 80 insertions(+), 16 deletions(-)
> 
> --
> 2.14.1.3.gb7cf6e02401b

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] NetworkPkg: Correct HttpTlsCipherList.h file format to DOS

2018-03-25 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Liming Gao
> Sent: Sunday, March 25, 2018 7:10 PM
> To: edk2-devel@lists.01.org
> Cc: Fu, Siyuan <siyuan...@intel.com>; Wu, Jiaxin <jiaxin...@intel.com>
> Subject: [edk2] [Patch] NetworkPkg: Correct HttpTlsCipherList.h file
> format to DOS
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Liming Gao <liming@intel.com>
> Cc: Wu Jiaxin <jiaxin...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> ---
>  NetworkPkg/Include/Guid/HttpTlsCipherList.h | 76 ++--
> -
>  1 file changed, 38 insertions(+), 38 deletions(-)
> 
> diff --git a/NetworkPkg/Include/Guid/HttpTlsCipherList.h
> b/NetworkPkg/Include/Guid/HttpTlsCipherList.h
> index bbfe488..bd30231 100644
> --- a/NetworkPkg/Include/Guid/HttpTlsCipherList.h
> +++ b/NetworkPkg/Include/Guid/HttpTlsCipherList.h
> @@ -1,38 +1,38 @@
> -/** @file
> -  This file defines the HttpTlsCipherList variable for HTTPS to configure
> Tls Cipher List.
> -
> -Copyright (c) 2018, Intel Corporation. All rights reserved.
> -This program and the accompanying materials are licensed and made
> available under
> -the terms and conditions of the BSD License that accompanies this
> distribution.
> -The full text of the license may be found at
> -http://opensource.org/licenses/bsd-license.php.
> -
> -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
> IMPLIED.
> -
> -**/
> -
> -#ifndef __HTTP_TLS_CIPHER_LIST_H__
> -#define __HTTP_TLS_CIPHER_LIST_H__
> -
> -//
> -// Private Variable for HTTPS to configure Tls Cipher List.
> -// 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}
> -//
> -#define EDKII_HTTP_TLS_CIPHER_LIST_GUID \
> -  { \
> -0x46ddb415, 0x5244, 0x49c7, { 0x93, 0x74, 0xf0, 0xe2, 0x98, 0xe7,
> 0xd3, 0x86 } \
> -  }
> -
> -#define EDKII_HTTP_TLS_CIPHER_LIST_VARIABLE   L"HttpTlsCipherList"
> -
> -extern EFI_GUID gEdkiiHttpTlsCipherListGuid;
> -
> -#endif
> -
> +/** @file
> +  This file defines the HttpTlsCipherList variable for HTTPS to configure
> Tls Cipher List.
> +
> +Copyright (c) 2018, Intel Corporation. All rights reserved.
> +This program and the accompanying materials are licensed and made
> available under
> +the terms and conditions of the BSD License that accompanies this
> distribution.
> +The full text of the license may be found at
> +http://opensource.org/licenses/bsd-license.php.
> +
> +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
> IMPLIED.
> +
> +**/
> +
> +#ifndef __HTTP_TLS_CIPHER_LIST_H__
> +#define __HTTP_TLS_CIPHER_LIST_H__
> +
> +//
> +// Private Variable for HTTPS to configure Tls Cipher List.
> +// 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}
> +//
> +#define EDKII_HTTP_TLS_CIPHER_LIST_GUID \
> +  { \
> +0x46ddb415, 0x5244, 0x49c7, { 0x93, 0x74, 0xf0, 0xe2, 0x98, 0xe7,
> 0xd3, 0x86 } \
> +  }
> +
> +#define EDKII_HTTP_TLS_CIPHER_LIST_VARIABLE   L"HttpTlsCipherList"
> +
> +extern EFI_GUID gEdkiiHttpTlsCipherListGuid;
> +
> +#endif
> +
> --
> 2.8.0.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] NetworkPkg/UefiPxeBcDxe: Configure the ARP Instance/RouteTable with new address

2018-03-20 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>


> -Original Message-
> From: Wu, Jiaxin
> Sent: Tuesday, March 20, 2018 9:10 AM
> To: edk2-devel@lists.01.org
> Cc: Fu, Siyuan <siyuan...@intel.com>; Ye, Ting <ting...@intel.com>
> Subject: [Patch] NetworkPkg/UefiPxeBcDxe: Configure the ARP
> Instance/RouteTable with new address
> 
> 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...@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu <jiaxin...@intel.com>
> ---
>  NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c| 26 +++---
>  NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c | 66 -
> -
>  2 files changed, 52 insertions(+), 40 deletions(-)
> 
> diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
> b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
> index d3146c3a7e..b828d24288 100644
> --- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
> +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
> @@ -2001,11 +2001,10 @@ EfiPxeBcSetStationIP (
>)
>  {
>EFI_STATUS  Status;
>PXEBC_PRIVATE_DATA  *Private;
>EFI_PXE_BASE_CODE_MODE  *Mode;
> -  EFI_ARP_CONFIG_DATA ArpConfigData;
> 
>if (This == NULL) {
>  return EFI_INVALID_PARAMETER;
>}
> 
> @@ -2041,31 +2040,10 @@ EfiPxeBcSetStationIP (
>  //
>  Status = PxeBcRegisterIp6Address (Private, >v6);
>  if (EFI_ERROR (Status)) {
>goto ON_EXIT;
>  }
> -  } else if (!Mode->UsingIpv6 && NewStationIp != NULL) {
> -//
> -// Configure the corresponding ARP with the IPv4 address.
> -//
> -ZeroMem (, sizeof (EFI_ARP_CONFIG_DATA));
> -
> -ArpConfigData.SwAddressType   = 0x0800;
> -ArpConfigData.SwAddressLength = (UINT8) sizeof (EFI_IPv4_ADDRESS);
> -ArpConfigData.StationAddress  = >v4;
> -
> -Private->Arp->Configure (Private->Arp, NULL);
> -Private->Arp->Configure (Private->Arp, );
> -
> -if (NewSubnetMask != NULL) {
> -  Mode->RouteTableEntries= 1;
> -  Mode->RouteTable[0].IpAddr.Addr[0] = NewStationIp->Addr[0] &
> NewSubnetMask->Addr[0];
> -  Mode->RouteTable[0].SubnetMask.Addr[0] = NewSubnetMask->Addr[0];
> -  Mode->RouteTable[0].GwAddr.Addr[0] = 0;
> -}
> -
> -Private->IsAddressOk = TRUE;
>}
> 
>if (NewStationIp != NULL) {
>  CopyMem (>StationIp, NewStationIp, sizeof (EFI_IP_ADDRESS));
>  CopyMem (>StationIp, NewStationIp, sizeof (EFI_IP_ADDRESS));
> @@ -2075,10 +2053,14 @@ EfiPxeBcSetStationIP (
>  CopyMem (>SubnetMask, NewSubnetMask, sizeof (EFI_IP_ADDRESS));
>  CopyMem (>SubnetMask ,NewSubnetMask, sizeof
> (EFI_IP_ADDRESS));
>}
> 
>Status = PxeBcFlushStationIp (Private, NewStationIp, NewSubnetMask);
> +  if (!EFI_ERROR (Status)) {
> +Private->IsAddressOk = TRUE;
> +  }
> +
>  ON_EXIT:
>return Status;
>  }
> 
> 
> diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
> b/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
> index 47bb7c5dbb..4b6f8c9c7f 100644
> --- a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
> +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
> @@ -1,9 +1,9 @@
>  /** @file
>Support functions implementation for UefiPxeBc Driver.
> 
> -  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
> +  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
> 
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the
> BSD License
>which accompanies this distribution.  The full text of the license may
> be found at
>http://opensource.org/licenses/bsd-license.php.
> @@ -34,21 +34,23 @@ PxeBcFlushStationIp (
>EFI_IP_ADDRESS   *SubnetMask OPTIONAL
>)
>  {
>EFI_PXE_BASE_CODE_MODE   *Mode;
>EFI_STATUS   Status;
> +  EFI_ARP_CONFIG_DATA  ArpConfigData;
> 
>Mode   = Private->PxeBc.Mode;
>Status = EFI_SUCCESS;
> +  ZeroMem (, sizeof (EFI_ARP_CONFIG_DATA));
> 
> -  if (Mode->UsingIpv6) {
> -
> -if (StationIp != NULL) {
> -  CopyMem (>Udp6CfgData.StationAddress, StationIp, sizeof
> (EFI_IPv6_ADDRESS));
> -  CopyMem (>Ip6CfgData.StationAddress, StationIp, sizeof
> (EFI_IPv6_ADDRESS));
> -}
> -
> +  if (Mode->UsingIpv6 && StationIp != NULL) {
> +//
> +// Overwrite Udp6CfgData/Ip6CfgData StationAddress

Re: [edk2] [Patch 0/3] Support HTTP large data request via TLS channel.

2018-03-20 Thread Fu, Siyuan


Serials Reviewed-by: Fu Siyuan <siyuan...@intel.com>



> -Original Message-
> From: Wu, Jiaxin
> Sent: Tuesday, March 20, 2018 8:37 AM
> To: edk2-devel@lists.01.org
> Cc: Karunakar P <karunak...@amiindia.co.in>; Fu, Siyuan
> <siyuan...@intel.com>; Ye, Ting <ting...@intel.com>
> Subject: [Patch 0/3] Support HTTP large data request via TLS channel.
> 
> Cc: Karunakar P <karunak...@amiindia.co.in>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu <jiaxin...@intel.com>
> 
> Jiaxin Wu (3):
>   MdePkg/Tls1.h: Add TLS record header length and max payload length.
>   NetworkPkg/TlsDxe: Handle the multiple TLS record messages
> encryption/decryption.
>   NetworkPkg/HttpDxe: Handle the large data request via HTTPS channel.
> 
>  MdePkg/Include/IndustryStandard/Tls1.h |  16 -
>  NetworkPkg/HttpDxe/HttpProto.c | 121 
> -
>  NetworkPkg/HttpDxe/HttpsSupport.c  |  17 -
>  NetworkPkg/HttpDxe/HttpsSupport.h  |  12 +++-
>  NetworkPkg/TlsDxe/TlsImpl.c|  74 +---
>  NetworkPkg/TlsDxe/TlsImpl.h|   6 +-
>  6 files changed, 178 insertions(+), 68 deletions(-)
> 
> --
> 2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] internal structure of EFI_TLS_CA_CERTIFICATE_VARIABLE

2018-03-20 Thread Fu, Siyuan
Hi, Laszlo

The data structure of EFI_TLS_CA_CERTIFICATE_VARIABLE is EFI_SIGNATURE_LIST and 
we have documented this in HTTPs Boot wiki page: 
https://github.com/tianocore/tianocore.github.io/wiki/HTTPS-Boot

You can refer section 31.4.1 "Signature Database" in UEFI 2.7 A for a detail 
description of EFI_SIGNATURE_LIST structure.


BestRegards
Fu Siyuan


> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Tuesday, March 20, 2018 10:56 PM
> To: Wu, Jiaxin <jiaxin...@intel.com>; Fu, Siyuan <siyuan...@intel.com>
> Cc: edk2-devel-01 <edk2-devel@lists.01.org>; Daniel P. Berrange
> <berra...@redhat.com>
> Subject: internal structure of EFI_TLS_CA_CERTIFICATE_VARIABLE
> 
> Hi Jiaxin, Siyuan,
> 
> setting *multiple* CA certificates for HTTPS server verification looks
> possible, from the following call tree:
> 
> TlsConfigCertificate()  [NetworkPkg/HttpDxe/HttpsSupport.c]
>   TlsConfigurationSetData() [NetworkPkg/TlsDxe/TlsConfigProtocol.c]
> TlsSetCaCertificate()   [CryptoPkg/Library/TlsLib/TlsConfig.c]
>   X509_STORE_add_cert()
> 
> because the outermost TlsConfigCertificate() function implements a loop
> over the EFI_TLS_CA_CERTIFICATE_VARIABLE contents.
> 
> Is there natural-language documentation available about the internal
> structure of EFI_TLS_CA_CERTIFICATE_VARIABLE?
> 
> Because, OVMF should avoid taking one format of CA Cert list from QEMU
> (i.e. from the virtualization host) and converting it to the format
> expected by TlsConfigCertificate(). Instead, the "update-ca-trust"
> command should be taught (on the host system) to generate a binary
> certificate list file (somewhere under "/etc/pki/ca-trust/extracted", I
> believe) such that the file can be used directly for setting
> EFI_TLS_CA_CERTIFICATE_VARIABLE in the guest.
> 
> In order to write such an extractor for "update-ca-trust", the format of
> EFI_TLS_CA_CERTIFICATE_VARIABLE should be publicly documented. Also, a
> promise of stability wouldn't hurt. :)
> 
> (To refer back to the cipher suite list discussion
> <https://lists.01.org/pipermail/edk2-devel/2018-February/020944.html>,
> this stability / public documentation goal was guaranteed there, due to
> EFI_TLS_CIPHER being specified publicly.)
> 
> Thanks!
> Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the poll function.

2018-03-01 Thread Fu, Siyuan
Jiaxin, 

There will be problem if someone calls Mtftp.Start() at TPL Callback to 
send/receive a file with your patch. In such case the RestoreTpl() won't be 
able to restore the TPL to application level so it will still while loop in the 
Poll.

BestRegards
Fu Siyuan

> -Original Message-
> From: Wu, Jiaxin
> Sent: Friday, March 2, 2018 9:18 AM
> To: Fu, Siyuan <siyuan...@intel.com>; edk2-devel@lists.01.org
> Cc: Wang, Fan <fan.w...@intel.com>; Ye, Ting <ting...@intel.com>
> Subject: RE: [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the
> poll function.
> 
> It's not actual hang but always running at while-poll function in the TPL
> call back level , meanwhile, the while condition depends on another time
> event that running on the same TPL. If so, the time event might have no
> chance to be triggered. So, the code will never run out of while () {}:
> 
>   while (Token->Status == EFI_NOT_READY) {
> This->Poll (This);
>   }
> 
> 
> Thanks,
> Jiaxin
> 
> > -Original Message-
> > From: Fu, Siyuan
> > Sent: Thursday, March 1, 2018 7:03 PM
> > To: Wu, Jiaxin <jiaxin...@intel.com>; edk2-devel@lists.01.org
> > Cc: Wang, Fan <fan.w...@intel.com>; Ye, Ting <ting...@intel.com>
> > Subject: RE: [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the
> > poll function.
> >
> > Hi, Jiaxin
> >
> > Do you mean the code which calls MTFTP4->Poll() at TPL_CALLBACK will
> > cause system hang? This should not happen because all network protocol
> > should be able to run at TPL_CALLBACK.
> >
> > BestRegards
> > Fu Siyuan
> >
> >
> > > -Original Message-
> > > From: Wu, Jiaxin
> > > Sent: Thursday, March 1, 2018 5:38 PM
> > > To: edk2-devel@lists.01.org
> > > Cc: Wang, Fan <fan.w...@intel.com>; Fu, Siyuan <siyuan...@intel.com>;
> > Ye,
> > > Ting <ting...@intel.com>
> > > Subject: [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the
> > poll
> > > function.
> > >
> > > This patch is to fix the hang issue, which was enrolled by the commit
> of
> > > 39b0867d.
> > > The TPL should be restored before calling poll function at
> TPL_CALLBACK.
> > >
> > > Cc: Wang Fan <fan.w...@intel.com>
> > > Cc: Fu Siyuan <siyuan...@intel.com>
> > > Cc: Ye Ting <ting...@intel.com>
> > > Contributed-under: TianoCore Contribution Agreement 1.0
> > > Signed-off-by: Jiaxin Wu <jiaxin...@intel.com>
> > > ---
> > >  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 9
> > ++---
> > >  1 file changed, 6 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> > > b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> > > index f5f9e6d8f7..64e0463dd9 100644
> > > --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> > > +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
> > > @@ -507,24 +507,27 @@ Mtftp4Start (
> > >if (EFI_ERROR (Status)) {
> > >  Status = EFI_DEVICE_ERROR;
> > >  goto ON_ERROR;
> > >}
> > >
> > > +  //
> > > +  // Restore the TPL now, don't call poll function at TPL_CALLBACK.
> > > +  //
> > > +  gBS->RestoreTPL (OldTpl);
> > > +
> > >if (Token->Event != NULL) {
> > > -gBS->RestoreTPL (OldTpl);
> > >  return EFI_SUCCESS;
> > >}
> > >
> > >//
> > >// Return immediately for asynchronous operation or poll the
> > >// instance for synchronous operation.
> > >//
> > >while (Token->Status == EFI_NOT_READY) {
> > >  This->Poll (This);
> > >}
> > > -
> > > -  gBS->RestoreTPL (OldTpl);
> > > +
> > >return Token->Status;
> > >
> > >  ON_ERROR:
> > >Mtftp4CleanOperation (Instance, Status);
> > >gBS->RestoreTPL (OldTpl);
> > > --
> > > 2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] NetworkPkg/HttpDxe: Support HTTP Delete Method.

2018-02-26 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>

> -Original Message-
> From: Wu, Jiaxin
> Sent: Tuesday, February 27, 2018 11:53 AM
> To: edk2-devel@lists.01.org
> Cc: Karunakar P <karunak...@amiindia.co.in>; Ye, Ting <ting...@intel.com>;
> Fu, Siyuan <siyuan...@intel.com>; Wu, Jiaxin <jiaxin...@intel.com>
> Subject: [Patch] NetworkPkg/HttpDxe: Support HTTP Delete Method.
> 
> 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 <karunak...@amiindia.co.in>
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
> ---
>  NetworkPkg/HttpDxe/HttpImpl.c | 9 +
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
> index b3a64cf516..a2af59674a 100644
> --- a/NetworkPkg/HttpDxe/HttpImpl.c
> +++ b/NetworkPkg/HttpDxe/HttpImpl.c
> @@ -1,9 +1,9 @@
>  /** @file
>Implementation of EFI_HTTP_PROTOCOL protocol interfaces.
> 
> -  Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
> +  Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
>(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
> 
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the
> BSD License
>which accompanies this distribution.  The full text of the license may
> be found at
> @@ -279,15 +279,16 @@ EfiHttpRequest (
>}
> 
>Request = HttpMsg->Data.Request;
> 
>//
> -  // Only support GET, HEAD, PATCH, PUT and POST method in current
> implementation.
> +  // Only support GET, HEAD, DELETE, PATCH, PUT and POST method in
> current implementation.
>//
>if ((Request != NULL) && (Request->Method != HttpMethodGet) &&
> -  (Request->Method != HttpMethodHead) && (Request->Method !=
> HttpMethodPut) &&
> -  (Request->Method != HttpMethodPost) && (Request->Method !=
> HttpMethodPatch)) {
> +  (Request->Method != HttpMethodHead) && (Request->Method !=
> HttpMethodDelete) &&
> +  (Request->Method != HttpMethodPut) && (Request->Method !=
> HttpMethodPost) &&
> +  (Request->Method != HttpMethodPatch)) {
>  return EFI_UNSUPPORTED;
>}
> 
>HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This);
> 
> --
> 2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] MdeModulePkg/Mtftp4Dxe: Separate the timer ticking to calculate the packet live time.

2018-03-01 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan <siyuan...@intel.com>


> -Original Message-
> From: Wu, Jiaxin
> Sent: Friday, March 2, 2018 2:43 PM
> To: edk2-devel@lists.01.org
> Cc: Fu, Siyuan <siyuan...@intel.com>; Wang, Fan <fan.w...@intel.com>; Ye,
> Ting <ting...@intel.com>
> Subject: [Patch] MdeModulePkg/Mtftp4Dxe: Separate the timer ticking to
> calculate the packet live time.
> 
> From: Fu Siyuan <siyuan...@intel.com>
> 
> 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.w...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Fu Siyuan <siyuan...@intel.com>
> Signed-off-by: Jiaxin Wu <jiaxin...@intel.com>
> ---
>  .../Universal/Network/Mtftp4Dxe/Mtftp4Driver.c | 34 ++---
>  .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c   |  5 +-
>  .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.h   |  6 ++-
>  .../Universal/Network/Mtftp4Dxe/Mtftp4Support.c| 57
> +-
>  .../Universal/Network/Mtftp4Dxe/Mtftp4Support.h| 16 +-
>  5 files changed, 97 insertions(+), 21 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c
> b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c
> index a23d405baa..713cc66dd1 100644
> --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c
> +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c
> @@ -1,9 +1,9 @@
>  /** @file
>Implementation of Mtftp drivers.
> 
> -Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
>  This program and the accompanying materials
>  are licensed and made available under the terms and conditions of the BSD
> License
>  which accompanies this distribution.  The full text of the license may be
> found at
>  http://opensource.org/licenses/bsd-license.php
> 
> @@ -160,15 +160,16 @@ Mtftp4CreateService (
>MtftpSb->Signature  = MTFTP4_SERVICE_SIGNATURE;
>MtftpSb->ServiceBinding = gMtftp4ServiceBindingTemplete;
>MtftpSb->ChildrenNum= 0;
>InitializeListHead (>Children);
> 
> -  MtftpSb->Timer  = NULL;
> -  MtftpSb->TimerToGetMap  = NULL;
> -  MtftpSb->Controller = Controller;
> -  MtftpSb->Image  = Image;
> -  MtftpSb->ConnectUdp = NULL;
> +  MtftpSb->Timer= NULL;
> +  MtftpSb->TimerNotifyLevel = NULL;
> +  MtftpSb->TimerToGetMap= NULL;
> +  MtftpSb->Controller   = Controller;
> +  MtftpSb->Image= Image;
> +  MtftpSb->ConnectUdp   = NULL;
> 
>//
>// Create the timer and a udp to be notified when UDP is uninstalled
>//
>Status = gBS->CreateEvent (
> @@ -176,12 +177,24 @@ Mtftp4CreateService (
>TPL_CALLBACK,
>Mtftp4OnTimerTick,
>MtftpSb,
>>Timer
>);
> +  if (EFI_ERROR (Status)) {
> +FreePool (MtftpSb);
> +return Status;
> +  }
> 
> +  Status = gBS->CreateEvent (
> +  EVT_NOTIFY_SIGNAL | EVT_TIMER,
> +  TPL_NOTIFY,
> +  Mtftp4OnTimerTickNotifyLevel,
> +  MtftpSb,
> +  >TimerNotifyLevel
> +  );
>if (EFI_ERROR (Status)) {
> +gBS->CloseEvent (MtftpSb->Timer);
>  FreePool (MtftpSb);
>  return Status;
>}
> 
>//
> @@ -194,10 +207,11 @@ Mtftp4CreateService (
>NULL,
>NULL,
>>TimerToGetMap
>);
>if (EFI_ERROR (Status)) {
> +gBS->CloseEvent (MtftpSb->TimerNotifyLevel);
>  gBS->CloseEvent (MtftpSb->Timer);
>  FreePool (MtftpSb);
>  return Status;
>}
> 
> @@ -209,10 +223,11 @@ Mtftp4CreateService (
>NULL
>);
> 
>if (MtftpSb->ConnectUdp == NULL) {
>  gBS->CloseEvent (MtftpSb->TimerToGetMap);
> +gBS->CloseEvent (MtftpSb->TimerNotifyLevel);
>  gBS->CloseEvent (MtftpSb->Timer);
>  FreePool (MtftpSb);
>  return EFI_DEVICE_ERROR;
>}
> 
> @@ -232,10 +247,11 @@ Mtftp4CleanService (
>IN MTFTP4_SERVICE *MtftpSb
>)
>  {
>UdpIoFreeIo (MtftpSb->ConnectUdp);
>gBS->CloseEven

Re: [edk2] [Patch] NetworkPkg/HttpDxe: Fix the bug when parsing HTTP(S) message body.

2018-06-28 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan 

> -Original Message-
> From: Wu, Jiaxin
> Sent: Wednesday, June 27, 2018 3:47 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting ; Fu, Siyuan ; Wu,
> Jiaxin 
> Subject: [Patch] NetworkPkg/HttpDxe: Fix the bug when parsing HTTP(S)
> message body.
> 
> 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 
> Cc: Fu Siyuan 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin 
> ---
>  NetworkPkg/HttpDxe/HttpImpl.c  | 114 +
>  NetworkPkg/HttpDxe/HttpProto.c |  10 +++
>  NetworkPkg/HttpDxe/HttpProto.h |  12 +++-
>  3 files changed, 79 insertions(+), 57 deletions(-)
> 
> diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
> index a2af59674a..7f601db5c6 100644
> --- a/NetworkPkg/HttpDxe/HttpImpl.c
> +++ b/NetworkPkg/HttpDxe/HttpImpl.c
> @@ -914,10 +914,11 @@ HttpBodyParserCallback (
>IN CHAR8  *Data,
>IN UINTN  Length,
>IN VOID   *Context
>)
>  {
> +  HTTP_CALLBACK_DATA*CallbackData;
>HTTP_TOKEN_WRAP   *Wrap;
>UINTN BodyLength;
>CHAR8 *Body;
> 
>if (EventType != BodyParseEventOnComplete) {
> @@ -926,24 +927,21 @@ HttpBodyParserCallback (
> 
>if (Data == NULL || Length != 0 || Context == NULL) {
>  return EFI_SUCCESS;
>}
> 
> -  Wrap = (HTTP_TOKEN_WRAP *) Context;
> -  Body = Wrap->HttpToken->Message->Body;
> -  BodyLength = Wrap->HttpToken->Message->BodyLength;
> +  CallbackData = (HTTP_CALLBACK_DATA *) Context;
> +
> +  Wrap   = (HTTP_TOKEN_WRAP *) (CallbackData->Wrap);
> +  Body   = CallbackData->ParseData;
> +  BodyLength = CallbackData->ParseDataLength;
> +
>if (Data < Body + BodyLength) {
>  Wrap->HttpInstance->NextMsg = Data;
>} else {
>  Wrap->HttpInstance->NextMsg = NULL;
>}
> -
> -
> -  //
> -  // Free Tx4Token or Tx6Token since already received corrsponding HTTP
> response.
> -  //
> -  FreePool (Wrap);
> 
>return EFI_SUCCESS;
>  }
> 
>  /**
> @@ -1189,33 +1187,43 @@ HttpResponseWorker (
>   HttpInstance->Method,
>   HttpMsg->Data.Response->StatusCode,
>   HttpMsg->HeaderCount,
>   HttpMsg->Headers,
>   HttpBodyParserCallback,
> - (VOID *) ValueInItem,
> + (VOID *) (>CallbackData),
>   >MsgParser
>   );
>if (EFI_ERROR (Status)) {
>  goto Error2;
>}
> 
>//
>// Check whether we received a complete HTTP message.
>//
>if (HttpInstance->CacheBody != NULL) {
> +//
> +// Record the CallbackData data.
> +//
> +HttpInstance->CallbackData.Wrap = (VOID *) Wrap;
> +HttpInstance->CallbackData.ParseData = (VOID *) HttpInstance-
> >CacheBody;
> +HttpInstance->CallbackData.ParseDataLength = HttpInstance-
> >CacheLen;
> +
> +//
> +// Parse message with CallbackData data.
> +//
>  Status = HttpParseMessageBody (HttpInstance->MsgParser,
> HttpInstance->CacheLen, HttpInstance->CacheBody);
>  if (EFI_ERROR (Status)) {
>goto Error2;
>  }
> +  }
> 
> -if (HttpIsMessageComplete (HttpInstance->MsgParser)) {
> -  //
> -  // Free the MsgParse since we already have a full HTTP message.
> -  //
> -  HttpFreeMsgParser (HttpInstance->MsgParser);
> -  HttpInstance->MsgParser = NULL;
> -}
> +  if (HttpIsMessageComplete (HttpInstance->MsgParser)) {
> +//
> +// Free the MsgParse since we already have a full HTTP message.
> +//
> +HttpFreeMsgParser (HttpInstance->MsgParser);
> +HttpInstance->MsgParser = NULL;
>}
>  }
> 
>  if ((HttpMsg->Body == NULL) || (HttpMsg->BodyLength == 0)) {
>Status = EFI_SUCCESS;
> @@ -1330,16 +1338,30 @@ HttpResponseWorker (
>  if (EFI_ERROR (Status)) {
>goto Error2;
>  }
> 
>  //
> -// Check whether we receive a complete HTTP message.
> +// Process the received the body pac

Re: [edk2] [Patch] MdeModulePkg/Tcp4Dxe: Remove the trailing white space in one line.

2018-10-07 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan 



> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jiaxin Wu
> Sent: Monday, October 8, 2018 11:08 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting ; Bi, Dandan ; Fu,
> Siyuan ; Wu, Jiaxin 
> Subject: [edk2] [Patch] MdeModulePkg/Tcp4Dxe: Remove the trailing white
> space in one line.
> 
> Cc: Fu Siyuan 
> Cc: Ye Ting 
> Cc: Bi Dandan 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Wu Jiaxin 
> ---
>  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
> b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
> index fb7f4f8502..7c0504770b 100644
> --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
> +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
> @@ -1,17 +1,17 @@
>  ## @file
>  #  This module produces EFI TCPv4 Protocol and EFI TCPv4 Service Binding
> Protocol.
>  #
>  #  This module produces EFI TCPv4(Transmission Control Protocol version 4)
> Protocol
> -#  upon EFI IPv4 Protocol, to provide basic TCPv4 I/O services. This
> driver only
> +#  upon EFI IPv4 Protocol, to provide basic TCPv4 I/O services. This
> driver only
>  #  supports IPv4 network stack.
>  #
>  #  Notes:
>  #  1) This driver can't co-work with the TcpDxe driver in NetworkPkg.
> -#  2) This driver might have some issues that have been fixed in the
> TcpDxe driver
> +#  2) This driver might have some issues that have been fixed in the
> TcpDxe driver
>  # in NetworkPkg.
> -#  3) This driver supports fewer features than the TcpDxe driver in
> NetworkPkg (e.g. IPv6,
> +#  3) This driver supports fewer features than the TcpDxe driver in
> NetworkPkg (e.g. IPv6,
>  # TCP Cancel function).
>  #  4) TcpDxe driver in NetworkPkg is recommended for use instead of this
> one even though
>  # both of them can be used.
>  #
>  #  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> --
> 2.17.1.windows.2
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 0/2] Correct comments to align with the input parameter.

2018-10-07 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan 


> -Original Message-
> From: Wu, Jiaxin
> Sent: Monday, October 8, 2018 11:03 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Fu, Siyuan
> ; Ye, Ting ; Bi, Dandan
> ; Wu, Jiaxin 
> Subject: [Patch 0/2] Correct comments to align with the input parameter.
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1230
> 
> Cc: Carsey Jaben 
> Cc: Fu Siyuan 
> Cc: Ye Ting 
> Cc: Bi Dandan 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Wu Jiaxin 
> 
> Jiaxin Wu (2):
>   NetworkPkg/UefiPxeBcDxe: Correct comments to align with the input
> parameter.
>   ShellPkg/TftpDynamicCommand: Correct comments to align with the input
> parameter.
> 
>  NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.c  | 11 ++-
>  NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h  |  5 -
>  ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c |  2 ++
>  3 files changed, 16 insertions(+), 2 deletions(-)
> 
> --
> 2.17.1.windows.2

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] NetworkPkg/TlsDxe: Remove the redundant library class.

2018-10-15 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan 

> -Original Message-
> From: Wu, Jiaxin
> Sent: Tuesday, October 16, 2018 9:55 AM
> To: edk2-devel@lists.01.org
> Cc: Fu, Siyuan ; Ye, Ting ; Wu,
> Jiaxin 
> Subject: [Patch] NetworkPkg/TlsDxe: Remove the redundant library class.
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1018.
> 
> Cc: Fu Siyuan 
> Cc: Ye Ting 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Wu Jiaxin 
> ---
>  NetworkPkg/TlsDxe/TlsDxe.inf | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/NetworkPkg/TlsDxe/TlsDxe.inf b/NetworkPkg/TlsDxe/TlsDxe.inf
> index 907feb735b..aaea0fc2ff 100644
> --- a/NetworkPkg/TlsDxe/TlsDxe.inf
> +++ b/NetworkPkg/TlsDxe/TlsDxe.inf
> @@ -3,11 +3,11 @@
>  #  EFI TLS Configuration Protocol.
>  #
>  #  This module produces EFI TLS (Transport Layer Security) Protocol and
> EFI TLS
>  #  Service Binding Protocol, to provide TLS services.
>  #
> -#  Copyright (c) 2016, Intel Corporation. All rights reserved.
> +#  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
>  #
>  #  This program and the accompanying materials
>  #  are licensed and made available under the terms and conditions of the
> BSD License
>  #  which accompanies this distribution. The full text of the license may
> be found at
>  #  http://opensource.org/licenses/bsd-license.php.
> @@ -50,11 +50,10 @@
>MemoryAllocationLib
>BaseMemoryLib
>BaseLib
>UefiLib
>DebugLib
> -  NetLib
>BaseCryptLib
>TlsLib
> 
>  [Protocols]
>gEfiTlsServiceBindingProtocolGuid  ## PRODUCES
> --
> 2.17.1.windows.2

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 0/4] Conflict Detection for Tcp and PxeBc Driver

2018-10-29 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan 


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Songpeng Li
> Sent: Monday, October 29, 2018 1:48 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting ; Fu, Siyuan ; Wu,
> Jiaxin 
> Subject: [edk2] [PATCH v2 0/4] Conflict Detection for Tcp and PxeBc Driver
> 
> v2: Modify files:
>   UefiPxeBcDxe.inf from MdeModulePkg
>   UefiPxeBcDxe.inf from NetworkPkg
>   tag protocol guid should be marked as BY_START
> 
> Please refer to the log message of each commit for more details.
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1278
> Cc: Ye Ting 
> Cc: Wu Jiaxin 
> Cc: Fu Siyuan 
> Songpeng Li (4):
>   MdeModulePkg: Add Tag Protocol for PxeBc Driver Conflict Detection.
>   MdeModulePkg/UefiPxeBcDxe: Add Conflict Detection Process.
>   NetworkPkg/UefiPxeBcDxe: Add Conflict Detection Process.
>   NetworkPkg/TcpDxe: Modify the Version of Driver Binding Protocol
> 
>  MdeModulePkg/Include/Protocol/PxeBcTag.h  | 26 
>  MdeModulePkg/MdeModulePkg.dec |  5 +++
>  .../Network/UefiPxeBcDxe/PxeBcDriver.c| 19 -
>  .../Network/UefiPxeBcDxe/PxeBcImpl.h  |  3 +-
>  .../Network/UefiPxeBcDxe/UefiPxeBcDxe.inf |  1 +
>  NetworkPkg/TcpDxe/TcpDriver.c |  4 +-
>  NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c | 42 ++-
>  NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h   |  1 +
>  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf  |  1 +
>  9 files changed, 96 insertions(+), 6 deletions(-)
>  create mode 100644 MdeModulePkg/Include/Protocol/PxeBcTag.h
> 
> --
> 2.18.0.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 2/4] MdeModulePkg/UefiPxeBcDxe: Add Conflict Detection Process.

2018-10-28 Thread Fu, Siyuan
Hi, Songpeng

The tag protocol guid is installed in driver binding start so it should be 
marked as BY_START in INF file.

> +  gEdkiiPxeBcTagProtocolGuid   ## SOMETIMES_CONSUMES

BestRegards
Fu Siyuan

> -Original Message-
> From: Li, Songpeng
> Sent: Monday, October 29, 2018 9:53 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting ; Wu, Jiaxin ; Fu,
> Siyuan 
> Subject: [PATCH 2/4] MdeModulePkg/UefiPxeBcDxe: Add Conflict Detection
> Process.
> 
> The current PxeBc Driver in MdeModulePkg and NetworkPkg has no conflict
> detection when both installed in platform, this process is for conflict
> driver detect.
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1278
> Cc: Ye Ting 
> Cc: Wu Jiaxin 
> Cc: Fu Siyuan 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Songpeng Li 
> ---
>  .../Network/UefiPxeBcDxe/PxeBcDriver.c| 19 ++-
>  .../Network/UefiPxeBcDxe/PxeBcImpl.h  |  3 ++-
>  .../Network/UefiPxeBcDxe/UefiPxeBcDxe.inf |  1 +
>  3 files changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c
> b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c
> index 76c140d8e3..bd16f8b2e2 100644
> --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c
> +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c
> @@ -1,7 +1,7 @@
>  /** @file
>The driver binding for UEFI PXEBC protocol.
> 
> -Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.
> +Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
>  This program and the accompanying materials
>  are licensed and made available under the terms and conditions of the BSD
> License
>  which accompanies this distribution.  The full text of the license may be
> found at
> @@ -84,6 +84,19 @@ PxeBcDriverBindingSupported (
>EFI_PXE_BASE_CODE_PROTOCOL  *PxeBc;
>EFI_STATUS  Status;
> 
> +  Status = gBS->OpenProtocol (
> +  ControllerHandle,
> +  ,
> +  NULL,
> +  This->DriverBindingHandle,
> +  ControllerHandle,
> +  EFI_OPEN_PROTOCOL_TEST_PROTOCOL
> +  );
> +
> +  if (!EFI_ERROR (Status)) {
> +return EFI_ALREADY_STARTED;
> +  }
> +
>Status = gBS->OpenProtocol (
>ControllerHandle,
>,
> @@ -370,6 +383,8 @@ PxeBcDriverBindingStart (
>>PxeBc,
>,
>>LoadFile,
> +  ,
> +  NULL,
>NULL
>);
>if (EFI_ERROR (Status)) {
> @@ -573,6 +588,8 @@ PxeBcDriverBindingStop (
>>PxeBc,
>,
>>LoadFile,
> +  ,
> +  NULL,
>NULL
>);
> 
> diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.h
> b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.h
> index e96b6f2c5d..0fceb35b82 100644
> --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.h
> +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.h
> @@ -1,6 +1,6 @@
>  /** @file
> 
> -Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
> +Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
>  This program and the accompanying materials
>  are licensed and made available under the terms and conditions of the BSD
> License
>  which accompanies this distribution.  The full text of the license may be
> found at
> @@ -32,6 +32,7 @@ typedef struct _PXEBC_PRIVATE_DATA  PXEBC_PRIVATE_DATA;
>  #include 
>  #include 
>  #include 
> +#include 
> 
>  #include 
>  #include 
> diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
> b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
> index 0424019929..dc255534cb 100644
> --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
> +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
> @@ -94,6 +94,7 @@
>gEfiIp4ServiceBindingProtocolGuid## TO_START
>gEfiIp4ProtocolGuid  ## TO_START
>gEfiIp4Config2ProtocolGuid   ## TO_START
> +  gEdkiiPxeBcTagProtocolGuid   ## SOMETIMES_CONSUMES
> 
>  [Pcd]
>gEfiMdeModulePkgTokenSpaceGuid.PcdTftpBlockSize  ## SOMETIMES_CONSUMES
> --
> 2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 2/7] EmulatorPkg: Replace obsoleted network drivers from platform DSC/FDF.

2018-10-30 Thread Fu Siyuan
This patch replaces the MdeModulePkg TCP, PXE and iSCSI driver with those
ones in NetworkPkg. These 3 drivers in MdeModulePkg are not being actively
maintained and will be removed from edk2 master soon.

Cc: Jordan Justen 
Cc: Andrew Fish 
Cc: Ruiyu Ni 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---
 EmulatorPkg/EmulatorPkg.dsc | 2 +-
 EmulatorPkg/EmulatorPkg.fdf | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
index c8c444fe1c89..3bfb48b9 100644
--- a/EmulatorPkg/EmulatorPkg.dsc
+++ b/EmulatorPkg/EmulatorPkg.dsc
@@ -378,8 +378,8 @@ [Components]
   MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
   MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
   MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
-  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
   MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
+  NetworkPkg/TcpDxe/TcpDxe.inf
 
   MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
diff --git a/EmulatorPkg/EmulatorPkg.fdf b/EmulatorPkg/EmulatorPkg.fdf
index 5b5f81443dff..4595796d5185 100644
--- a/EmulatorPkg/EmulatorPkg.fdf
+++ b/EmulatorPkg/EmulatorPkg.fdf
@@ -203,7 +203,7 @@ [FV.FvRecovery]
 INF  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
 INF  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
 INF  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
-INF  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
+INF  NetworkPkg/TcpDxe/TcpDxe.inf
 INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
 
 INF FatPkg/EnhancedFatDxe/Fat.inf
-- 
2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 4/7] Vlv2TbltDevicePkg: Replace obsoleted drivers from platform DSC/FDF.

2018-10-30 Thread Fu Siyuan
This patch replaces the MdeModulePkg TCP, PXE and iSCSI driver with those
ones in NetworkPkg. These 3 drivers in MdeModulePkg are not being actively
maintained and will be removed from edk2 master soon.

Cc: David Wei 
Cc: Mang Guo 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---
 Vlv2TbltDevicePkg/PlatformPkg.fdf   | 14 +++---
 Vlv2TbltDevicePkg/PlatformPkgGcc.fdf| 14 +++---
 Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 18 +++---
 Vlv2TbltDevicePkg/PlatformPkgIA32.dsc   | 18 +++---
 Vlv2TbltDevicePkg/PlatformPkgX64.dsc| 18 +++---
 5 files changed, 15 insertions(+), 67 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PlatformPkg.fdf 
b/Vlv2TbltDevicePkg/PlatformPkg.fdf
index b7a0e584deeb..241314bed4e9 100644
--- a/Vlv2TbltDevicePkg/PlatformPkg.fdf
+++ b/Vlv2TbltDevicePkg/PlatformPkg.fdf
@@ -744,6 +744,9 @@ [FV.FVMAIN]
   INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
   INF  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
   INF  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
+  INF  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
+  INF  NetworkPkg/TcpDxe/TcpDxe.inf
+  INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
   !if $(NETWORK_IP6_ENABLE) == TRUE
   INF  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
   INF  NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
@@ -751,22 +754,11 @@ [FV.FVMAIN]
   INF  NetworkPkg/Udp6Dxe/Udp6Dxe.inf
   INF  NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
   !endif
-  !if $(NETWORK_IP6_ENABLE) == TRUE
-  INF  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  INF  NetworkPkg/TcpDxe/TcpDxe.inf
-  !else
-  INF  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  INF  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
-  !endif
   !if $(NETWORK_VLAN_ENABLE) == TRUE
   INF  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
   !endif
   !if $(NETWORK_ISCSI_ENABLE) == TRUE
-  !if $(NETWORK_IP6_ENABLE) == TRUE
 INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
-  !else
-INF  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
-  !endif
   !endif
 !endif
 
diff --git a/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf 
b/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf
index eca273e33f88..356649277289 100644
--- a/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf
+++ b/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf
@@ -700,6 +700,9 @@ [FV.FVMAIN]
   INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
   INF  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
   INF  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
+  INF  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
+  INF  NetworkPkg/TcpDxe/TcpDxe.inf
+  INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
   !if $(NETWORK_IP6_ENABLE) == TRUE
   INF  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
   INF  NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
@@ -707,22 +710,11 @@ [FV.FVMAIN]
   INF  NetworkPkg/Udp6Dxe/Udp6Dxe.inf
   INF  NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
   !endif
-  !if $(NETWORK_IP6_ENABLE) == TRUE
-  INF  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  INF  NetworkPkg/TcpDxe/TcpDxe.inf
-  !else
-  INF  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  INF  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
-  !endif
   !if $(NETWORK_VLAN_ENABLE) == TRUE
   INF  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
   !endif
   !if $(NETWORK_ISCSI_ENABLE) == TRUE
-  !if $(NETWORK_IP6_ENABLE) == TRUE
 INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
-  !else
-INF  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
-  !endif
   !endif
 !endif
 
diff --git a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc 
b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
index 3e3522aee908..322793257e0b 100644
--- a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
+++ b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
@@ -1528,11 +1528,7 @@ [Components.X64]
 
 !if $(NETWORK_ENABLE) == TRUE
   !if $(NETWORK_ISCSI_ENABLE) == TRUE
-!if $(NETWORK_IP6_ENABLE) == TRUE
-  NetworkPkg/IScsiDxe/IScsiDxe.inf
-!else
-  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
-!endif
+NetworkPkg/IScsiDxe/IScsiDxe.inf
   !endif
   !if $(NETWORK_VLAN_ENABLE) == TRUE
 MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
@@ -1554,24 +1550,16 @@ [Components.X64]
 MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
 MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
-MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf {
-  
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000
-}
+NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
+NetworkPkg/TcpDxe/TcpDxe.inf
 MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
 !if $(NETWORK_IP6_ENABLE) == TRUE
   NetworkPkg/Ip6Dxe/Ip6Dxe.inf
   NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
   NetworkPkg/IpSecDxe/IpSecDxe.inf
-  NetworkPkg/TcpDxe/TcpDxe.inf
   NetworkPkg/Udp6Dxe/Udp6Dxe.inf
   NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
 !endif
-!if $(NETWORK_IP6_ENABLE) == TRUE
-  NetworkPkg/UefiPxeBcDxe

[edk2] [PATCH v1 3/7] OvmfPkg: Replace obsoleted network drivers from platform DSC/FDF.

2018-10-30 Thread Fu Siyuan
This patch replaces the MdeModulePkg TCP, PXE and iSCSI driver with those
ones in NetworkPkg. These 3 drivers in MdeModulePkg are not being actively
maintained and will be removed from edk2 master soon.

Cc: Jordan Justen 
Cc: Laszlo Ersek 
Cc: Ard Biesheuvel 
Cc: Anthony Perard 
Cc: Julien Grall 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---
 OvmfPkg/OvmfPkgIa32.dsc| 12 
 OvmfPkg/OvmfPkgIa32.fdf| 10 +++---
 OvmfPkg/OvmfPkgIa32X64.dsc | 12 
 OvmfPkg/OvmfPkgIa32X64.fdf | 10 +++---
 OvmfPkg/OvmfPkgX64.dsc | 12 
 OvmfPkg/OvmfPkgX64.fdf | 10 +++---
 6 files changed, 21 insertions(+), 45 deletions(-)

diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 9f07e75050c0..bdd1169c58a2 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -790,18 +790,14 @@ [Components]
   MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
   MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
   MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
-!if $(NETWORK_IP6_ENABLE) == TRUE
-  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
+  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
   NetworkPkg/TcpDxe/TcpDxe.inf
+  NetworkPkg/IScsiDxe/IScsiDxe.inf
+!if $(NETWORK_IP6_ENABLE) == TRUE
+  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
   NetworkPkg/Udp6Dxe/Udp6Dxe.inf
   NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
   NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  NetworkPkg/IScsiDxe/IScsiDxe.inf
-!else
-  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
-  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 !endif
 !if $(HTTP_BOOT_ENABLE) == TRUE
   NetworkPkg/DnsDxe/DnsDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
index 52b8b1fea1fc..1bc2e73bde16 100644
--- a/OvmfPkg/OvmfPkgIa32.fdf
+++ b/OvmfPkg/OvmfPkgIa32.fdf
@@ -309,18 +309,14 @@ [FV.DXEFV]
   INF  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
   INF  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
   INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
+  INF  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
+  INF  NetworkPkg/TcpDxe/TcpDxe.inf
+  INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
 !if $(NETWORK_IP6_ENABLE) == TRUE
   INF  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
-  INF  NetworkPkg/TcpDxe/TcpDxe.inf
   INF  NetworkPkg/Udp6Dxe/Udp6Dxe.inf
   INF  NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
   INF  NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-  INF  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
-!else
-  INF  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
-  INF  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  INF  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 !endif
 !if $(HTTP_BOOT_ENABLE) == TRUE
   INF  NetworkPkg/DnsDxe/DnsDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index a4eaeb808c6b..d4b09b38194d 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -799,18 +799,14 @@ [Components.X64]
   MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
   MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
   MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
-!if $(NETWORK_IP6_ENABLE) == TRUE
-  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
+  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
   NetworkPkg/TcpDxe/TcpDxe.inf
+  NetworkPkg/IScsiDxe/IScsiDxe.inf
+!if $(NETWORK_IP6_ENABLE) == TRUE
+  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
   NetworkPkg/Udp6Dxe/Udp6Dxe.inf
   NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
   NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  NetworkPkg/IScsiDxe/IScsiDxe.inf
-!else
-  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
-  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 !endif
 !if $(HTTP_BOOT_ENABLE) == TRUE
   NetworkPkg/DnsDxe/DnsDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
index 70845d6972fd..f36c7e741c8e 100644
--- a/OvmfPkg/OvmfPkgIa32X64.fdf
+++ b/OvmfPkg/OvmfPkgIa32X64.fdf
@@ -315,18 +315,14 @@ [FV.DXEFV]
   INF  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
   INF  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
   INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
+  INF  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
+  INF  NetworkPkg/TcpDxe/TcpDxe.inf
+  INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
 !if $(NETWORK_IP6_ENABLE) == TRUE
   INF  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
-  INF  NetworkPkg/TcpDxe/TcpDxe.inf
   INF  NetworkPkg/Udp6Dxe/Udp6Dxe.inf
   INF  NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
   INF  NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-  INF  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
-!else
-  INF  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
-  INF  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  INF  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 !endif
 !if $(HTTP_BOOT_ENABLE) == TRUE

[edk2] [PATCH v1 7/7] NetworkPkg: Remove some clarification from TCP/PXE/ISCSI driver INF.

2018-10-30 Thread Fu Siyuan
This patch is to remove the clarification about usage/difference between
those drivers in MdeModulePkg and NetworkPkg, since the MdeModulePkg ones
have been deleted now.

Cc: Jiaxin Wu 
Cc: Ye Ting 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---
 NetworkPkg/IScsiDxe/IScsiDxe.inf | 10 --
 NetworkPkg/TcpDxe/TcpDxe.inf |  6 --
 NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf |  6 --
 3 files changed, 22 deletions(-)

diff --git a/NetworkPkg/IScsiDxe/IScsiDxe.inf b/NetworkPkg/IScsiDxe/IScsiDxe.inf
index 195dc191250f..bdf1313aa957 100644
--- a/NetworkPkg/IScsiDxe/IScsiDxe.inf
+++ b/NetworkPkg/IScsiDxe/IScsiDxe.inf
@@ -4,16 +4,6 @@
 #  The iSCSI driver provides iSCSI service in the preboot environment and 
supports
 #  booting over iSCSI. This driver supports both IPv4 and IPv6 network stack.
 #
-#  Notes:
-#  1) This driver can't co-work with the IScsiDxe driver in MdeModulePkg.
-#  2) This driver includes more bug fixes and supports more features (e.g. 
IPv6, Dns
-# support for target URL configuration, iSCSI keyword support) than the 
IscsiDxe
-# driver in MdeModulePkg. So, we recommend using this driver even though 
both of
-# them can be used.
-#  3) This driver depends on OpenSSL. To use this driver, please follow the
-# instructions found in the file "OpenSSL-HOWTO.txt" located in
-# CryptoPkg\Library\OpensslLib to enable the OpenSSL building first.
-#
 # Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
 # This program and the accompanying materials
 # are licensed and made available under the terms and conditions of the BSD 
License
diff --git a/NetworkPkg/TcpDxe/TcpDxe.inf b/NetworkPkg/TcpDxe/TcpDxe.inf
index 9433fb875cba..c4e3de7ec5ce 100644
--- a/NetworkPkg/TcpDxe/TcpDxe.inf
+++ b/NetworkPkg/TcpDxe/TcpDxe.inf
@@ -5,12 +5,6 @@
 #  It might provide TCPv4 Protocol or TCPv6 Protocol or both of them that 
depends on which network
 #  stack has been loaded in system. This driver supports both IPv4 and IPv6 
network stack.
 #
-#  Notes:
-#  1) This driver can't co-work with the Tcp4Dxe driver in MdeModulePkg.
-#  2) This driver includes more bug fixes and supports more features (e.g. 
IPv6, TCP Cancel
-# function) than the Tcp4Dxe driver in MdeModulePkg. So, we recommend 
using this driver
-# even though both of them can be used.
-#
 #  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
 #
 #  This program and the accompanying materials
diff --git a/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf 
b/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
index 130a5456e2c1..63430711e71b 100644
--- a/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
+++ b/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
@@ -5,12 +5,6 @@
 #  PXE-compatible device for network access or booting. This driver supports
 #  both IPv4 and IPv6 network stack.
 #
-#  Notes:
-#  1) This driver can't co-work with the UefiPxeBcDxe driver in MdeModulePkg.
-#  2) This driver includes more bug fixes and supports more features (e.g. 
IPv6,
-# MTFTP windowsize) than the UefiPxeBcDxe driver in MdeModulePkg. So, we
-# recommend using this driver even though both of them can be used.
-#
 #  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
 #
 #  This program and the accompanying materials
-- 
2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 1/7] Nt32Pkg: Replace obsoleted network drivers from NT32 platform DSC/FDF.

2018-10-30 Thread Fu Siyuan
This patch replaces the MdeModulePkg TCP, PXE and iSCSI driver with those
ones in NetworkPkg. These 3 drivers in MdeModulePkg are not being actively
maintained and will be removed from edk2 master soon.

Cc: Ruiyu Ni 
Cc: Hao Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---
 Nt32Pkg/Nt32Pkg.dsc | 12 
 Nt32Pkg/Nt32Pkg.fdf | 12 
 2 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/Nt32Pkg/Nt32Pkg.dsc b/Nt32Pkg/Nt32Pkg.dsc
index 58d9f8787dde..4293ca39fdec 100644
--- a/Nt32Pkg/Nt32Pkg.dsc
+++ b/Nt32Pkg/Nt32Pkg.dsc
@@ -4,7 +4,7 @@
 # The Emulation Platform can be used to debug individual modules, prior to 
creating
 #a real platform. This also provides an example for how an DSC is created.
 #
-# Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
 # Copyright (c) 2015, Hewlett-Packard Development Company, L.P.
 # (C) Copyright 2016 Hewlett Packard Enterprise Development LP
 #
@@ -468,20 +468,16 @@ [Components]
   MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
   MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
   MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
+  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
+  NetworkPkg/TcpDxe/TcpDxe.inf
+  NetworkPkg/IScsiDxe/IScsiDxe.inf
   Nt32Pkg/SnpNt32Dxe/SnpNt32Dxe.inf
 
 !if $(NETWORK_IP6_ENABLE) == TRUE
   NetworkPkg/Ip6Dxe/Ip6Dxe.inf
   NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
-  NetworkPkg/TcpDxe/TcpDxe.inf
   NetworkPkg/Udp6Dxe/Udp6Dxe.inf
   NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  NetworkPkg/IScsiDxe/IScsiDxe.inf
-!else
-  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
-  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 !endif
 
   NetworkPkg/HttpBootDxe/HttpBootDxe.inf
diff --git a/Nt32Pkg/Nt32Pkg.fdf b/Nt32Pkg/Nt32Pkg.fdf
index db2719fd99df..65d9bf812b5b 100644
--- a/Nt32Pkg/Nt32Pkg.fdf
+++ b/Nt32Pkg/Nt32Pkg.fdf
@@ -1,7 +1,7 @@
 ## @file
 # This is NT32 FDF file with UEFI HII features enabled
 #
-# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
 # (C) Copyright 2016 Hewlett Packard Enterprise Development LP
 #
 #This program and the accompanying materials
@@ -257,19 +257,15 @@ [FV.FvRecovery]
 INF  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
 INF  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
 INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
+INF  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
+INF  NetworkPkg/TcpDxe/TcpDxe.inf
+INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
 INF  Nt32Pkg/SnpNt32Dxe/SnpNt32Dxe.inf
 !if $(NETWORK_IP6_ENABLE) == TRUE
 INF  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
 INF  NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
 INF  NetworkPkg/Udp6Dxe/Udp6Dxe.inf
 INF  NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-INF  NetworkPkg/TcpDxe/TcpDxe.inf
-INF  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
-!else
-INF  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
-INF  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
-INF  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 !endif
 INF  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
 INF  NetworkPkg/DnsDxe/DnsDxe.inf
-- 
2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 0/7] Delete TCP, PXE, iSCSI driver in MdeModulePkg.

2018-10-30 Thread Fu Siyuan
This patch series is to delete the Tcp4Dxe, UefiPxeBcDxe and IScsi4Dxe
drivers in MdeModulePkg. These drivers will not be maintained and can't
co-work with the dual-stack drivers in NetworkPkg.

People should use below NetworkPkg drivers instead:
  NetworkPkg/IScsiDxe/IScsiDxe.inf
  NetworkPkg/TcpDxe/TcpDxe.inf
  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
These drivers are actively maintained with more bug fixes and new feature
support.

Patch 1~5 update edk2 platform DSC/FDF files to use NetworkPkg drivers.
Patch 6 deletes the TCP,PXE,iSCSI driver in MdeModulePkg.
Patch 7 removes some clarification in NetworkPkg drivers since the
related driver has been deleted in Patch 6.

Fu Siyuan (7):
  Nt32Pkg: Replace obsoleted network drivers from NT32 platform DSC/FDF.
  EmulatorPkg: Replace obsoleted network drivers from platform DSC/FDF.
  OvmfPkg: Replace obsoleted network drivers from platform DSC/FDF.
  Vlv2TbltDevicePkg: Replace obsoleted drivers from platform DSC/FDF.
  ArmVirtPkg: Replace obsoleted network drivers from platform DSC/FDF.
  MdeModulePkg: Delete the TCP/PXE/ISCSI drivers in MdeModulePkg.
  NetworkPkg: Remove some clarification from TCP/PXE/ISCSI driver INF.

 .../Network/IScsiDxe/ComponentName.c  |  283 --
 .../Universal/Network/IScsiDxe/IScsiCHAP.c|  430 ---
 .../Universal/Network/IScsiDxe/IScsiConfig.c  | 1264 ---
 .../Universal/Network/IScsiDxe/IScsiDhcp.c|  472 ---
 .../Universal/Network/IScsiDxe/IScsiDriver.c  |  676 
 .../Network/IScsiDxe/IScsiExtScsiPassThru.c   |  412 ---
 .../Universal/Network/IScsiDxe/IScsiIbft.c|  539 ---
 .../Network/IScsiDxe/IScsiInitiatorName.c |  116 -
 .../Universal/Network/IScsiDxe/IScsiMisc.c|  948 --
 .../Universal/Network/IScsiDxe/IScsiProto.c   | 2799 ---
 .../Universal/Network/IScsiDxe/IScsiTcp4Io.c  |  487 ---
 MdeModulePkg/Universal/Network/IScsiDxe/Md5.c |  350 --
 .../Universal/Network/Tcp4Dxe/ComponentName.c |  433 ---
 .../Universal/Network/Tcp4Dxe/SockImpl.c  | 1201 ---
 .../Universal/Network/Tcp4Dxe/SockInterface.c |  990 --
 .../Network/Tcp4Dxe/Tcp4Dispatcher.c  |  717 
 .../Universal/Network/Tcp4Dxe/Tcp4Driver.c|  782 -
 .../Universal/Network/Tcp4Dxe/Tcp4Input.c | 1497 -
 .../Universal/Network/Tcp4Dxe/Tcp4Io.c|  112 -
 .../Universal/Network/Tcp4Dxe/Tcp4Main.c  |  674 
 .../Universal/Network/Tcp4Dxe/Tcp4Misc.c  |  940 --
 .../Universal/Network/Tcp4Dxe/Tcp4Option.c|  352 --
 .../Universal/Network/Tcp4Dxe/Tcp4Output.c| 1238 ---
 .../Universal/Network/Tcp4Dxe/Tcp4Timer.c |  584 
 .../Network/UefiPxeBcDxe/ComponentName.c  |  365 --
 .../Network/UefiPxeBcDxe/PxeBcDhcp.c  | 1999 ---
 .../Network/UefiPxeBcDxe/PxeBcDriver.c|  665 
 .../Network/UefiPxeBcDxe/PxeBcImpl.c  | 2989 -
 .../Network/UefiPxeBcDxe/PxeBcMtftp.c |  454 ---
 .../Network/UefiPxeBcDxe/PxeBcSupport.c   |  221 --
 ArmVirtPkg/ArmVirtQemu.dsc|   10 +-
 ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc  |   10 +-
 ArmVirtPkg/ArmVirtQemuKernel.dsc  |   10 +-
 EmulatorPkg/EmulatorPkg.dsc   |2 +-
 EmulatorPkg/EmulatorPkg.fdf   |2 +-
 MdeModulePkg/MdeModulePkg.dsc |3 -
 .../Network/IScsiDxe/ComponentName.h  |  165 -
 .../Universal/Network/IScsiDxe/IScsi4Dxe.uni  |   25 -
 .../Network/IScsiDxe/IScsi4DxeExtra.uni   |   20 -
 .../Universal/Network/IScsiDxe/IScsiCHAP.h|  106 -
 .../Universal/Network/IScsiDxe/IScsiCommon.h  |   22 -
 .../Universal/Network/IScsiDxe/IScsiConfig.h  |  166 -
 .../Network/IScsiDxe/IScsiConfigDxe.vfr   |  219 --
 .../IScsiDxe/IScsiConfigDxeStrings.uni|   62 -
 .../Network/IScsiDxe/IScsiConfigNVDataStruc.h |  109 -
 .../Universal/Network/IScsiDxe/IScsiDhcp.h|   55 -
 .../Universal/Network/IScsiDxe/IScsiDriver.h  |  140 -
 .../Universal/Network/IScsiDxe/IScsiDxe.inf   |  134 -
 .../Network/IScsiDxe/IScsiExtScsiPassThru.h   |   22 -
 .../Universal/Network/IScsiDxe/IScsiIbft.h|   38 -
 .../Universal/Network/IScsiDxe/IScsiImpl.h|  168 -
 .../Network/IScsiDxe/IScsiInitiatorName.h |   74 -
 .../Universal/Network/IScsiDxe/IScsiMisc.h|  317 --
 .../Universal/Network/IScsiDxe/IScsiProto.h   | 1005 --
 .../Universal/Network/IScsiDxe/IScsiTcp4Io.h  |  142 -
 MdeModulePkg/Universal/Network/IScsiDxe/Md5.h |   80 -
 .../Universal/Network/Tcp4Dxe/SockImpl.h  |  131 -
 .../Universal/Network/Tcp4Dxe/Socket.h|  954 --
 .../Universal/Network/Tcp4Dxe/Tcp4Driver.h|  342 --
 .../Universal/Network/Tcp4Dxe/Tcp4Dxe.inf |   94 -
 .../Universal/Network/Tcp4Dxe/Tcp4Dxe.uni |   23 -
 .../Network/Tcp4Dxe/Tcp4DxeExtra.uni  |   20 -
 .../Universal/Network/Tcp4Dxe/Tcp4Func.h  |  781 -
 .../Universal/Network/Tcp4Dxe/Tcp4Main.h  |  494 ---
 .../Universal/Network/Tcp4Dxe/Tcp4Option.h|  130 -
 .../Universal/Network

[edk2] [PATCH v1 5/7] ArmVirtPkg: Replace obsoleted network drivers from platform DSC/FDF.

2018-10-30 Thread Fu Siyuan
This patch replaces the MdeModulePkg TCP, PXE and iSCSI driver with those
ones in NetworkPkg. These 3 drivers in MdeModulePkg are not being actively
maintained and will be removed from edk2 master soon.

Cc: Laszlo Ersek 
Cc: Ard Biesheuvel 
Cc: Julien Grall 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---
 ArmVirtPkg/ArmVirtQemu.dsc   | 10 +++---
 ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 10 +++---
 ArmVirtPkg/ArmVirtQemuKernel.dsc | 10 +++---
 3 files changed, 9 insertions(+), 21 deletions(-)

diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 885c6b14b844..b3f1b23e3890 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -346,18 +346,14 @@ [Components.common]
   MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
   MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
   MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
+  NetworkPkg/TcpDxe/TcpDxe.inf
+  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
+  NetworkPkg/IScsiDxe/IScsiDxe.inf
 !if $(NETWORK_IP6_ENABLE) == TRUE
   NetworkPkg/Ip6Dxe/Ip6Dxe.inf
-  NetworkPkg/TcpDxe/TcpDxe.inf
   NetworkPkg/Udp6Dxe/Udp6Dxe.inf
   NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
   NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  NetworkPkg/IScsiDxe/IScsiDxe.inf
-!else
-  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
-  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 !endif
 !if $(HTTP_BOOT_ENABLE) == TRUE
   NetworkPkg/DnsDxe/DnsDxe.inf
diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc 
b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
index a6390bd4b841..3316f982695f 100644
--- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
+++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
@@ -126,18 +126,14 @@ [FV.FvMain]
   INF MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
   INF MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
   INF MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
+  INF NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
+  INF NetworkPkg/IScsiDxe/IScsiDxe.inf
+  INF NetworkPkg/TcpDxe/TcpDxe.inf
 !if $(NETWORK_IP6_ENABLE) == TRUE
   INF NetworkPkg/Ip6Dxe/Ip6Dxe.inf
-  INF NetworkPkg/TcpDxe/TcpDxe.inf
   INF NetworkPkg/Udp6Dxe/Udp6Dxe.inf
   INF NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
   INF NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-  INF NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  INF NetworkPkg/IScsiDxe/IScsiDxe.inf
-!else
-  INF MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
-  INF MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  INF MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 !endif
 !if $(HTTP_BOOT_ENABLE) == TRUE
   INF NetworkPkg/DnsDxe/DnsDxe.inf
diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
index 434d6861a56f..e3ed713cbb39 100644
--- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
+++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
@@ -335,18 +335,14 @@ [Components.common]
   MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
   MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
   MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
+  NetworkPkg/TcpDxe/TcpDxe.inf
+  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
+  NetworkPkg/IScsiDxe/IScsiDxe.inf
 !if $(NETWORK_IP6_ENABLE) == TRUE
   NetworkPkg/Ip6Dxe/Ip6Dxe.inf
-  NetworkPkg/TcpDxe/TcpDxe.inf
   NetworkPkg/Udp6Dxe/Udp6Dxe.inf
   NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
   NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  NetworkPkg/IScsiDxe/IScsiDxe.inf
-!else
-  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
-  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 !endif
 !if $(HTTP_BOOT_ENABLE) == TRUE
   NetworkPkg/DnsDxe/DnsDxe.inf
-- 
2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v1] Edk2Platforms: Replace MdeModulePkg PXE/iSCSI/TCP with NetworkPkg drivers.

2018-10-31 Thread Fu, Siyuan
Hi, Leif

So you have tested all the platform build? That's great, thanks a lot.

Do you want me to merge these 3 patches to a combo v2 patch, or can you help to 
commit the patch set to edk2-platform repo?

BestRegards
Fu Siyuan


> -Original Message-
> From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> Sent: Thursday, November 1, 2018 12:53 AM
> To: Fu, Siyuan 
> Cc: edk2-devel@lists.01.org; Ard Biesheuvel ;
> Kinney, Michael D 
> Subject: Re: [PATCH v1] Edk2Platforms: Replace MdeModulePkg PXE/iSCSI/TCP
> with NetworkPkg drivers.
> 
> On Wed, Oct 31, 2018 at 11:38:51AM +0800, Fu Siyuan wrote:
> > The PXE/iSCSI/TCP drivers in MdeModulePkg are going to be deprecated.
> All
> > platform DSC/FDF files should be updated to use the dual-stack drivers
> in
> > NetworkPkg.
> >
> > The NetworkPkg driver have all the functionality compared with
> MdeModulePkg
> > one, with more bug fixes and new feature added. While its image size
> will
> > be a little bigger because it contains both IPv4 and IPv6 stack support,
> > so it may cause build error in a platform if the flash space is very
> tight.
> > Basically, this patch won't cause any other problem if build could pass.
> >
> > I haven't built all the updated platform because the repo ReadMe doesn't
> > provide a method to build them on Windows Environment, so I would very
> > appreciate if anybody can help to test the build or tell me how to build
> > it on Windows.
> 
> There are still some changes required to core ARM code to permit
> building full platform ports with Visual Studio. And I wouldn't ask
> you to set up a GCC windows development environment if you don't
> already have one.
> 
> I have added some additional modifications required to permit all of
> the platforms on master to build correctly after applying your
> patch. You can find them in the top commit of
> https://git.linaro.org/people/leif.lindholm/edk2-
> platforms.git/log/?h=networkpkg-fixups
> (plus a line ending fixup required to make that patch apply cleanly).
> 
> Regards,
> 
> Leif
> 
> > Cc: Ard Biesheuvel 
> > Cc: Leif Lindholm 
> > Cc: Michael D Kinney 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Fu Siyuan 
> > ---
> >  Platform/AMD/OverdriveBoard/OverdriveBoard.dsc  |  6 +++---
> >  Platform/AMD/OverdriveBoard/OverdriveBoard.fdf  |  6 +++---
> >  Platform/ARM/SgiPkg/SgiPlatform.fdf |  6 +++---
> >  Platform/ARM/VExpressPkg/ArmVExpress-networking.fdf.inc |  6 +++---
> >  Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc|  6 +++---
> >  Platform/Comcast/RDKQemu/RDKQemu.dsc| 10 +++---
> 
> >  Platform/Hisilicon/D03/D03.dsc  |  4 ++--
> >  Platform/Hisilicon/D03/D03.fdf  |  4 ++--
> >  Platform/Hisilicon/D05/D05.dsc  |  9 +++---
> ---
> >  Platform/Hisilicon/D05/D05.fdf  |  9 +++---
> ---
> >  Platform/Hisilicon/D06/D06.dsc  |  9 +++---
> ---
> >  Platform/Hisilicon/D06/D06.fdf  |  9 +++---
> ---
> >  Platform/Hisilicon/HiKey/HiKey.dsc  |  4 ++--
> >  Platform/Hisilicon/HiKey/HiKey.fdf  |  4 ++--
> >  Platform/Hisilicon/HiKey960/HiKey960.dsc|  4 ++--
> >  Platform/Hisilicon/HiKey960/HiKey960.fdf|  4 ++--
> >  Platform/LeMaker/CelloBoard/CelloBoard.dsc  |  6 +++---
> >  Platform/LeMaker/CelloBoard/CelloBoard.fdf  |  6 +++---
> >  Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc |  6 +++---
> >  Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.fdf |  6 +++---
> >  Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc   |  4 ++--
> >  Silicon/Marvell/Armada7k8k/Armada7k8k.fdf   |  4 ++--
> >  22 files changed, 58 insertions(+), 74 deletions(-)
> >
> > diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
> b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
> > index 9f9885fda8..51327a67df 100644
> > --- a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
> > +++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
> > @@ -669,11 +669,11 @@ DEFINE DO_CAPSULE   = FALSE
> >}
> >MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
> >MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
> > -  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
> >MdeModulePkg/Universal/Network/Udp

Re: [edk2] [PATCH v1] NetworkPkg/Mtftp6Dxe: Remove the trailing white spaces.

2018-10-31 Thread Fu, Siyuan



Reviewed-by: Fu Siyuan 


> -Original Message-
> From: Wu, Jiaxin
> Sent: Wednesday, October 31, 2018 4:46 PM
> To: edk2-devel@lists.01.org
> Cc: Fu, Siyuan ; Wu, Jiaxin 
> Subject: [PATCH v1] NetworkPkg/Mtftp6Dxe: Remove the trailing white spaces.
> 
> Cc: Fu Siyuan 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Wu Jiaxin 
> ---
>  NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h
> b/NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h
> index 57f4cb6f5d..f0279daca3 100644
> --- a/NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h
> +++ b/NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h
> @@ -84,11 +84,11 @@ struct _MTFTP6_INSTANCE {
> 
>//
>// Record the total received and saved block number.
>//
>UINT64TotalBlock;
> -
> +
>//
>// Record the acked block number.
>//
>UINT64AckedBlock;
> 
> --
> 2.17.1.windows.2

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Reminder for deleting 3 network drivers in MdeModulePkg

2018-10-30 Thread Fu, Siyuan
Hi, Leif

I think checking the branch is a little better than the tag, because we may 
still have critical bug fixes after the official release.

While any of them are not recommended, always using the NetworkPkg version 
driver is the best choice.

I will modify the edk2 network wiki page for an updated sample DSC/FDF section, 
if this patch could pass review w/o objection.
https://github.com/tianocore/tianocore.github.io/wiki/NetworkPkg-Getting-Started-Guide


BestRegards
Fu Siyuan


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Leif Lindholm
> Sent: Tuesday, October 30, 2018 6:47 PM
> To: Fu, Siyuan 
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] Reminder for deleting 3 network drivers in
> MdeModulePkg
> 
> Hi Fu Siyan,
> 
> On Tue, Oct 30, 2018 at 08:11:52AM +, Fu, Siyuan wrote:
> > People who want to continue use these deleted drivers could go to
> > edk2/UDK2018 branch to get them, but it's *highly not recommended*.
> 
> They should also be able to use edk2-stable201811, right?
> 
> > *If you have any opposition on deleting these drivers, please let me
> > know before this weekend, thanks.*
> 
> I am all for this change. The diffstat is very nice :)
> 
> Best Regards,
> 
> Leif
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v1 0/7] Delete TCP, PXE, iSCSI driver in MdeModulePkg.

2018-10-30 Thread Fu, Siyuan
Hi, Leif

I have followed your wiki page to configure my Git when I generate this patch, 
and I don't know why the files are still unordered and truncated. I will do 
more test and try to figure out the problem.

BestRegards
Fu Siyuan

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Leif Lindholm
> Sent: Tuesday, October 30, 2018 6:51 PM
> To: Fu, Siyuan 
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] [PATCH v1 0/7] Delete TCP, PXE, iSCSI driver in
> MdeModulePkg.
> 
> On Tue, Oct 30, 2018 at 03:33:21PM +0800, Fu Siyuan wrote:
> > This patch series is to delete the Tcp4Dxe, UefiPxeBcDxe and IScsi4Dxe
> > drivers in MdeModulePkg. These drivers will not be maintained and can't
> > co-work with the dual-stack drivers in NetworkPkg.
> >
> > People should use below NetworkPkg drivers instead:
> >   NetworkPkg/IScsiDxe/IScsiDxe.inf
> >   NetworkPkg/TcpDxe/TcpDxe.inf
> >   NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
> > These drivers are actively maintained with more bug fixes and new
> feature
> > support.
> >
> > Patch 1~5 update edk2 platform DSC/FDF files to use NetworkPkg drivers.
> > Patch 6 deletes the TCP,PXE,iSCSI driver in MdeModulePkg.
> > Patch 7 removes some clarification in NetworkPkg drivers since the
> > related driver has been deleted in Patch 6.
> >
> > Fu Siyuan (7):
> >   Nt32Pkg: Replace obsoleted network drivers from NT32 platform DSC/FDF.
> >   EmulatorPkg: Replace obsoleted network drivers from platform DSC/FDF.
> >   OvmfPkg: Replace obsoleted network drivers from platform DSC/FDF.
> >   Vlv2TbltDevicePkg: Replace obsoleted drivers from platform DSC/FDF.
> >   ArmVirtPkg: Replace obsoleted network drivers from platform DSC/FDF.
> >   MdeModulePkg: Delete the TCP/PXE/ISCSI drivers in MdeModulePkg.
> >   NetworkPkg: Remove some clarification from TCP/PXE/ISCSI driver INF.
> >
> >  .../Network/IScsiDxe/ComponentName.c  |  283 --
> >  .../Universal/Network/IScsiDxe/IScsiCHAP.c|  430 ---
> >  .../Universal/Network/IScsiDxe/IScsiConfig.c  | 1264 ---
> >  .../Universal/Network/IScsiDxe/IScsiDhcp.c|  472 ---
> >  .../Universal/Network/IScsiDxe/IScsiDriver.c  |  676 
> >  .../Network/IScsiDxe/IScsiExtScsiPassThru.c   |  412 ---
> >  .../Universal/Network/IScsiDxe/IScsiIbft.c|  539 ---
> >  .../Network/IScsiDxe/IScsiInitiatorName.c |  116 -
> >  .../Universal/Network/IScsiDxe/IScsiMisc.c|  948 --
> >  .../Universal/Network/IScsiDxe/IScsiProto.c   | 2799 ---
> >  .../Universal/Network/IScsiDxe/IScsiTcp4Io.c  |  487 ---
> 
> If there is a v2, can you follow the steps from
> https://github.com/tianocore/tianocore.github.io/wiki/Laszlo's-unkempt-
> git-guide-for-edk2-contributors-and-maintainers#contrib-23
> when generating it, to order the files, and to get rid of the
> ... truncation of file names?
> 
> Regards,
> 
> Leif
> 
> >  MdeModulePkg/Universal/Network/IScsiDxe/Md5.c |  350 --
> >  .../Universal/Network/Tcp4Dxe/ComponentName.c |  433 ---
> >  .../Universal/Network/Tcp4Dxe/SockImpl.c  | 1201 ---
> >  .../Universal/Network/Tcp4Dxe/SockInterface.c |  990 --
> >  .../Network/Tcp4Dxe/Tcp4Dispatcher.c  |  717 
> >  .../Universal/Network/Tcp4Dxe/Tcp4Driver.c|  782 -
> >  .../Universal/Network/Tcp4Dxe/Tcp4Input.c | 1497 -
> >  .../Universal/Network/Tcp4Dxe/Tcp4Io.c|  112 -
> >  .../Universal/Network/Tcp4Dxe/Tcp4Main.c  |  674 
> >  .../Universal/Network/Tcp4Dxe/Tcp4Misc.c  |  940 --
> >  .../Universal/Network/Tcp4Dxe/Tcp4Option.c|  352 --
> >  .../Universal/Network/Tcp4Dxe/Tcp4Output.c| 1238 ---
> >  .../Universal/Network/Tcp4Dxe/Tcp4Timer.c |  584 
> >  .../Network/UefiPxeBcDxe/ComponentName.c  |  365 --
> >  .../Network/UefiPxeBcDxe/PxeBcDhcp.c  | 1999 ---
> >  .../Network/UefiPxeBcDxe/PxeBcDriver.c|  665 
> >  .../Network/UefiPxeBcDxe/PxeBcImpl.c  | 2989 -
> >  .../Network/UefiPxeBcDxe/PxeBcMtftp.c |  454 ---
> >  .../Network/UefiPxeBcDxe/PxeBcSupport.c   |  221 --
> >  ArmVirtPkg/ArmVirtQemu.dsc|   10 +-
> >  ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc  |   10 +-
> >  ArmVirtPkg/ArmVirtQemuKernel.dsc  |   10 +-
> >  EmulatorPkg/EmulatorPkg.dsc   |2 +-
> >  EmulatorPkg/EmulatorPkg.fdf   |2 +-
> >  MdeModulePkg/MdeModulePkg.dsc |3 -
> >  .../Network/IScsiDxe/ComponentName.h  |  165 -
> >

Re: [edk2] [PATCH v1 0/7] Delete TCP, PXE, iSCSI driver in MdeModulePkg.

2018-10-30 Thread Fu, Siyuan
Mike,

Should I also update the devel branches in edk2-platform? Or the branch owner 
will take care of it?

BestRegards
Fu Siyuan


> -Original Message-
> From: Kinney, Michael D
> Sent: Wednesday, October 31, 2018 5:15 AM
> To: Fu, Siyuan ; Zeng, Star ;
> edk2-devel@lists.01.org; Kinney, Michael D 
> Cc: Leif Lindholm ; Andrew Fish (af...@apple.com)
> ; Laszlo Ersek (ler...@redhat.com) ;
> Gao, Liming 
> Subject: RE: [edk2] [PATCH v1 0/7] Delete TCP, PXE, iSCSI driver in
> MdeModulePkg.
> 
> Fu Siyuan,
> 
> Please review edk2-platform/master and prepare a patch
> for that branch if there are DSC/FDF files that refer
> to the network drivers that are being removed.
> 
> We should never break any platforms in edk2-platform/master.
> The commits should be performed to the repos in the correct
> order to guarantee no build breaks.
> 
> Thanks,
> 
> Mike
> 
> > -Original Message-
> > From: Fu, Siyuan
> > Sent: Tuesday, October 30, 2018 1:23 AM
> > To: Zeng, Star ; edk2-
> > de...@lists.01.org
> > Cc: Kinney, Michael D ; Leif
> > Lindholm ; Andrew Fish
> > (af...@apple.com) ; Laszlo Ersek
> > (ler...@redhat.com) ; Gao, Liming
> > 
> > Subject: RE: [edk2] [PATCH v1 0/7] Delete TCP, PXE,
> > iSCSI driver in MdeModulePkg.
> >
> > Hi, Star
> >
> > This patch only covers the platforms in
> > https://github.com/tianocore/edk2
> >
> > I will modify the edk2 network wiki page for an updated
> > sample DSC/FDF section, if this patch could pass review
> > w/o objection.
> > https://github.com/tianocore/tianocore.github.io/wiki/Ne
> > tworkPkg-Getting-Started-Guide
> >
> > Let's wait a few days to see if there is any objection
> > on deleting these driver first, and I will be happy to
> > generate another patch for edk2-platforms then.
> >
> > Thanks for your reminder.
> >
> >
> > BestRegards
> > Fu Siyuan
> >
> > > -Original Message-
> > > From: Zeng, Star
> > > Sent: Tuesday, October 30, 2018 3:43 PM
> > > To: Fu, Siyuan ; edk2-
> > de...@lists.01.org
> > > Cc: Kinney, Michael D ;
> > Leif Lindholm
> > > ; Andrew Fish
> > (af...@apple.com)
> > > ; Laszlo Ersek (ler...@redhat.com)
> > ;
> > > Gao, Liming ; Zeng, Star
> > 
> > > Subject: RE: [edk2] [PATCH v1 0/7] Delete TCP, PXE,
> > iSCSI driver in
> > > MdeModulePkg.
> > >
> > > Hi Siyuan,
> > >
> > > Have you checked the platforms in
> > https://github.com/tianocore/edk2-
> > > platforms to see whether they need to be updated
> > accordingly or not?
> > >
> > > Cc more people.
> > >
> > > Thanks,
> > > Star
> > > -Original Message-
> > > From: edk2-devel [mailto:edk2-devel-
> > boun...@lists.01.org] On Behalf Of Fu
> > > Siyuan
> > > Sent: Tuesday, October 30, 2018 3:33 PM
> > > To: edk2-devel@lists.01.org
> > > Subject: [edk2] [PATCH v1 0/7] Delete TCP, PXE, iSCSI
> > driver in
> > > MdeModulePkg.
> > >
> > > This patch series is to delete the Tcp4Dxe,
> > UefiPxeBcDxe and IScsi4Dxe
> > > drivers in MdeModulePkg. These drivers will not be
> > maintained and can't
> > > co-work with the dual-stack drivers in NetworkPkg.
> > >
> > > People should use below NetworkPkg drivers instead:
> > >   NetworkPkg/IScsiDxe/IScsiDxe.inf
> > >   NetworkPkg/TcpDxe/TcpDxe.inf
> > >   NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
> > > These drivers are actively maintained with more bug
> > fixes and new feature
> > > support.
> > >
> > > Patch 1~5 update edk2 platform DSC/FDF files to use
> > NetworkPkg drivers.
> > > Patch 6 deletes the TCP,PXE,iSCSI driver in
> > MdeModulePkg.
> > > Patch 7 removes some clarification in NetworkPkg
> > drivers since the related
> > > driver has been deleted in Patch 6.
> > >
> > > Fu Siyuan (7):
> > >   Nt32Pkg: Replace obsoleted network drivers from NT32
> > platform DSC/FDF.
> > >   EmulatorPkg: Replace obsoleted network drivers from
> > platform DSC/FDF.
> > >   OvmfPkg: Replace obsoleted network drivers from
> > platform DSC/FDF.
> > >   Vlv2TbltDevicePkg: Replace obsoleted drivers from
> > platform DSC/FDF.
> > >   ArmVirtPkg: Replace obsoleted network drivers from
> > platform DSC/FDF.
> > >   MdeModulePkg: Delete the TCP/PXE/ISCSI drivers in
> > MdeModulePkg.

Re: [edk2] [PATCH v1] NetworkPkg/TlsDxe: Fix failure to process multiple TLS records.

2018-10-30 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan 


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jiaxin Wu
> Sent: Wednesday, October 31, 2018 1:42 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting ; Fu, Siyuan ; Wu,
> Jiaxin 
> Subject: [edk2] [PATCH v1] NetworkPkg/TlsDxe: Fix failure to process
> multiple TLS records.
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1290.
> 
> Current implementation failed to parse the multiple TLS record
> messages due to the incorrect pointer of TLS record header. This
> patch is to resolve that problem.
> 
> Cc: Ye Ting 
> Cc: Fu Siyuan 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Wu Jiaxin 
> ---
>  NetworkPkg/TlsDxe/TlsImpl.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/NetworkPkg/TlsDxe/TlsImpl.c b/NetworkPkg/TlsDxe/TlsImpl.c
> index ea83dbd04f..2d4169b0a5 100644
> --- a/NetworkPkg/TlsDxe/TlsImpl.c
> +++ b/NetworkPkg/TlsDxe/TlsImpl.c
> @@ -142,11 +142,11 @@ TlsEncryptPacket (
>  }
> 
>  BufferOutSize += ThisMessageSize;
> 
>  BufferInPtr += TLS_RECORD_HEADER_LENGTH + ThisPlainMessageSize;
> -TempRecordHeader += ThisMessageSize;
> +TempRecordHeader = (TLS_RECORD_HEADER *)((UINT8 *)TempRecordHeader +
> ThisMessageSize);
>}
> 
>FreePool (BufferIn);
>BufferIn = NULL;
> 
> @@ -315,11 +315,11 @@ TlsDecryptPacket (
>  CopyMem (TempRecordHeader, RecordHeaderIn, TLS_RECORD_HEADER_LENGTH);
>  TempRecordHeader->Length = ThisPlainMessageSize;
>  BufferOutSize += TLS_RECORD_HEADER_LENGTH + ThisPlainMessageSize;
> 
>  BufferInPtr += TLS_RECORD_HEADER_LENGTH + ThisCipherMessageSize;
> -TempRecordHeader += TLS_RECORD_HEADER_LENGTH + ThisPlainMessageSize;
> +TempRecordHeader = (TLS_RECORD_HEADER *)((UINT8 *)TempRecordHeader +
> TLS_RECORD_HEADER_LENGTH + ThisPlainMessageSize);
>}
> 
>FreePool (BufferIn);
>BufferIn = NULL;
> 
> --
> 2.17.1.windows.2
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1] Edk2Platforms: Replace MdeModulePkg PXE/iSCSI/TCP with NetworkPkg Drivers.

2018-10-30 Thread Fu Siyuan
The PXE/iSCSI/TCP drivers in MdeModulePkg are going to be deprecated. All
platform DSC/FDF files should be updated to use the dual-stack drivers in
NetworkPkg.

Cc: Michael A Kubacki 
Cc: Jiewen Yao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---
 Platform/Intel/AdvancedFeaturePkg/Include/Dsc/CoreAdvancedDxeInclude.dsc  | 7 
++-
 Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvancedLateInclude.fdf | 7 
++-
 Platform/Intel/MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc   | 3 
+--
 3 files changed, 5 insertions(+), 12 deletions(-)

diff --git 
a/Platform/Intel/AdvancedFeaturePkg/Include/Dsc/CoreAdvancedDxeInclude.dsc 
b/Platform/Intel/AdvancedFeaturePkg/Include/Dsc/CoreAdvancedDxeInclude.dsc
index 4d70db6062..6764d46131 100644
--- a/Platform/Intel/AdvancedFeaturePkg/Include/Dsc/CoreAdvancedDxeInclude.dsc
+++ b/Platform/Intel/AdvancedFeaturePkg/Include/Dsc/CoreAdvancedDxeInclude.dsc
@@ -1,7 +1,7 @@
 ## @file
 #  Platform description.
 #
-# Copyright (c) 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.
 #
 # This program and the accompanying materials are licensed and made available 
under
 # the terms and conditions of the BSD License which accompanies this 
distribution.
@@ -26,10 +26,7 @@
   MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
   MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
   MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
-  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
   MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
-  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
-  #MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
 
   NetworkPkg/Ip6Dxe/Ip6Dxe.inf
   NetworkPkg/TcpDxe/TcpDxe.inf
@@ -42,7 +39,7 @@
   NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
   NetworkPkg/HttpBootDxe/HttpBootDxe.inf
 
-  #NetworkPkg/IScsiDxe/IScsiDxe.inf
+  NetworkPkg/IScsiDxe/IScsiDxe.inf
   NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
 !endif
 
diff --git 
a/Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvancedLateInclude.fdf 
b/Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvancedLateInclude.fdf
index 0be408d13b..64f1dd5872 100644
--- a/Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvancedLateInclude.fdf
+++ b/Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvancedLateInclude.fdf
@@ -1,7 +1,7 @@
 ## @file
 #  FDF file of Platform.
 #
-# Copyright (c) 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.
 #
 # This program and the accompanying materials are licensed and made available 
under
 # the terms and conditions of the BSD License which accompanies this 
distribution.
@@ -27,9 +27,6 @@ INF  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
 INF  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
 INF  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
 INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
-#INF  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
-INF  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
-#INF  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
 
 INF  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
 INF  NetworkPkg/TcpDxe/TcpDxe.inf
@@ -42,7 +39,7 @@ INF  NetworkPkg/HttpDxe/HttpDxe.inf
 INF  NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
 INF  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
 
-#INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
+INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
 INF  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
 !endif
 
diff --git a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc 
b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
index 2174eaa609..dd0173a1af 100644
--- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
+++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
@@ -1,7 +1,7 @@
 ## @file
 #  Platform description.
 #
-# Copyright (c) 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.
 #
 # This program and the accompanying materials are licensed and made available 
under
 # the terms and conditions of the BSD License which accompanies this 
distribution.
@@ -83,7 +83,6 @@
   UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
   TcpIoLib|MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf
   DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
-  TcpIoLib|MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf
   
OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
 
-- 
2.19.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


<    1   2   3   4   5   6   >