Hi,

 

I think I found a bug in
MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c

Regarding UEFI Specification 2.4 EFI_MTFTP_PROTCOL.GetInfo() (PDF page 1411)
in the related definitions of Override Data is mentioned that if I use a
ServerIp address of 0.0.0.0 the currently configured address is used
instead.

But the code that checks the incoming Override parameter is checked with
this function:

https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/Network
/Mtftp4Dxe/Mtftp4Impl.c#L187

 

BOOLEAN

Mtftp4OverrideValid (

  IN MTFTP4_PROTOCOL          *Instance,

  IN EFI_MTFTP4_OVERRIDE_DATA *Override

  )

{

  EFI_MTFTP4_CONFIG_DATA    *Config;

  IP4_ADDR                  Ip;

  IP4_ADDR                  Netmask;

  IP4_ADDR                  Gateway;

 

  CopyMem (&Ip, &Override->ServerIp, sizeof (IP4_ADDR));

  if (!NetIp4IsUnicast (NTOHL (Ip), 0)) {

    return FALSE;

  }

.

 

And if I pass there a 0.0.0.0 ip address the whole function returns FALSE
and the calling function returns EFI_INVALID_PARAMETER:

https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/Network
/Mtftp4Dxe/Mtftp4Impl.c#L411 

 

Did I get something wrong or is there a bug in the code?

Compared to the gateway the gateway address is only checked with the
NetIp4IsUnicast-function if it is not null:

https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/Network
/Mtftp4Dxe/Mtftp4Impl.c#L196 

 

  if (!Config->UseDefaultSetting && (Gateway != 0)) {
.

 

Regards,

Michael

 

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to