[edk2-devel] [PATCH v2] NetworkPkg:UEFIPXEBC

INDIA\sivaramann posted 1 patch 2 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/edk2 tags/patchew/1b052eda1c038b2d9e3502c679e0014db143a39b.1624516592.git.sivaramann@ami.com
NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
[edk2-devel] [PATCH v2] NetworkPkg:UEFIPXEBC
Posted by INDIA\sivaramann 2 years, 10 months ago
Issue on the PxeBcDhcp4CallBack() functions of UEFIPXEBC Driver.
In this function any non allowed events are recieved as input it
will exit in beginning itself. But the switch case handling the
default and Dhcp4SendRequest which is not reachable.

Signed-off-by: Sivaraman <sivaramann@ami.com>
---
 NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
index fb63cf61a9..e85176f9bb 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
@@ -1256,19 +1256,10 @@ PxeBcDhcp4CallBack (
 
     //
     // Cache the DHCPv4 discover packet to mode data directly.
-    // It need to check SendGuid as well as Dhcp4SendRequest.
+    // It need to check SendGuid.
     //
     CopyMem (&Mode->DhcpDiscover.Dhcpv4, &Packet->Dhcp4, Packet->Length);
 
-  case Dhcp4SendRequest:
-    if (Packet->Length > PXEBC_DHCP4_PACKET_MAX_SIZE) {
-      //
-      // If the to be sent packet exceeds the maximum length, abort the DHCP process.
-      //
-      Status = EFI_ABORTED;
-      break;
-    }
-
     if (Mode->SendGUID) {
       //
       // Send the system Guid instead of the MAC address as the hardware address if required.
@@ -1332,6 +1323,7 @@ PxeBcDhcp4CallBack (
     break;
 
   default:
+    ASSERT (FALSE);
     break;
   }
 
-- 
2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77065): https://edk2.groups.io/g/devel/message/77065
Mute This Topic: https://groups.io/mt/83760651/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v2] NetworkPkg:UEFIPXEBC
Posted by Maciej Rabeda 2 years, 10 months ago
Hi Siva,

I am fine with the patch per se, but I still have problems applying it.
Have you tried following my suggestions from our meeting?

Thanks,
Maciej

On 24-Jun-21 09:33, INDIA\sivaramann wrote:
> Issue on the PxeBcDhcp4CallBack() functions of UEFIPXEBC Driver.
> In this function any non allowed events are recieved as input it
> will exit in beginning itself. But the switch case handling the
> default and Dhcp4SendRequest which is not reachable.
>
> Signed-off-by: Sivaraman <sivaramann@ami.com>
> ---
>   NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c | 12 ++----------
>   1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
> index fb63cf61a9..e85176f9bb 100644
> --- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
> +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
> @@ -1256,19 +1256,10 @@ PxeBcDhcp4CallBack (
>   
>
>       //
>
>       // Cache the DHCPv4 discover packet to mode data directly.
>
> -    // It need to check SendGuid as well as Dhcp4SendRequest.
>
> +    // It need to check SendGuid.
>
>       //
>
>       CopyMem (&Mode->DhcpDiscover.Dhcpv4, &Packet->Dhcp4, Packet->Length);
>
>   
>
> -  case Dhcp4SendRequest:
>
> -    if (Packet->Length > PXEBC_DHCP4_PACKET_MAX_SIZE) {
>
> -      //
>
> -      // If the to be sent packet exceeds the maximum length, abort the DHCP process.
>
> -      //
>
> -      Status = EFI_ABORTED;
>
> -      break;
>
> -    }
>
> -
>
>       if (Mode->SendGUID) {
>
>         //
>
>         // Send the system Guid instead of the MAC address as the hardware address if required.
>
> @@ -1332,6 +1323,7 @@ PxeBcDhcp4CallBack (
>       break;
>
>   
>
>     default:
>
> +    ASSERT (FALSE);
>
>       break;
>
>     }
>
>   
>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77087): https://edk2.groups.io/g/devel/message/77087
Mute This Topic: https://groups.io/mt/83760651/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [EXTERNAL] Re: [edk2-devel] [PATCH v2] NetworkPkg:UEFIPXEBC
Posted by Sivaraman Nainar 2 years, 10 months ago
Hello Maciej:

I have applied the recommended rules in the git config and still the patches are generated with End of line encodings.

I will try to fix that and send the patch again.

Thanks
Siva
-----Original Message-----
From: Rabeda, Maciej <maciej.rabeda@linux.intel.com>
Sent: Friday, June 25, 2021 8:06 PM
To: devel@edk2.groups.io; emergingsiva@gmail.com
Cc: Sivaraman Nainar <sivaramann@ami.com>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v2] NetworkPkg:UEFIPXEBC


**CAUTION: The e-mail below is from an external source. Please exercise caution before opening attachments, clicking links, or following guidance.**

Hi Siva,

I am fine with the patch per se, but I still have problems applying it.
Have you tried following my suggestions from our meeting?

Thanks,
Maciej

On 24-Jun-21 09:33, INDIA\sivaramann wrote:
> Issue on the PxeBcDhcp4CallBack() functions of UEFIPXEBC Driver.
> In this function any non allowed events are recieved as input it will
> exit in beginning itself. But the switch case handling the default and
> Dhcp4SendRequest which is not reachable.
>
> Signed-off-by: Sivaraman <sivaramann@ami.com>
> ---
>   NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c | 12 ++----------
>   1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
> b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
> index fb63cf61a9..e85176f9bb 100644
> --- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
> +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
> @@ -1256,19 +1256,10 @@ PxeBcDhcp4CallBack (
>
>
>       //
>
>       // Cache the DHCPv4 discover packet to mode data directly.
>
> -    // It need to check SendGuid as well as Dhcp4SendRequest.
>
> +    // It need to check SendGuid.
>
>       //
>
>       CopyMem (&Mode->DhcpDiscover.Dhcpv4, &Packet->Dhcp4,
> Packet->Length);
>
>
>
> -  case Dhcp4SendRequest:
>
> -    if (Packet->Length > PXEBC_DHCP4_PACKET_MAX_SIZE) {
>
> -      //
>
> -      // If the to be sent packet exceeds the maximum length, abort the DHCP process.
>
> -      //
>
> -      Status = EFI_ABORTED;
>
> -      break;
>
> -    }
>
> -
>
>       if (Mode->SendGUID) {
>
>         //
>
>         // Send the system Guid instead of the MAC address as the hardware address if required.
>
> @@ -1332,6 +1323,7 @@ PxeBcDhcp4CallBack (
>       break;
>
>
>
>     default:
>
> +    ASSERT (FALSE);
>
>       break;
>
>     }
>
>
>

-The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77162): https://edk2.groups.io/g/devel/message/77162
Mute This Topic: https://groups.io/mt/83838289/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-