Hi Ruth,

 

I already changed my code. But the initial problem I was facing was:

I wanted to use the Override Data to only set a different Blocksize for one
MTFTP transfer.

So my thought was to set every Override Data parameter to zero as mentioned
in the spec and just change the Blocksize parameter.

But because of the EVI_INVALID_PARAMETER return that isn't working.

 

So now I'm doing another MTFTP->Configuration() call to change the Blocksize
right before I start my transfer an right after the transfer to set it back.

 

I can live with that but I don't think that's the best way to do it.

 

Regards,

Michael

 

Von: Li, Ruth [mailto:[email protected]] 
Gesendet: Freitag, 18. April 2014 12:09
An: [email protected]
Betreff: Re: [edk2] MdeModulePkg maintainer: Possible bug in
Network/Mtftp4Dxe/Mtftp4Impl.c

 

Hi Michael, 

 

Thanks for catching this. 

 

While we re-checked the spec, and realized there're some inconsistency in
the UEFI Spec about the Override Data definition. As we know, 0.0.0.0 is
clearly not a valid unicast address.

 

In "Related Definitions" under EFI_MTFTP4_PROTOCOL.GetInfo():

ServerIp IP address of the MTFTPv4 server. If set to 0.0.0.0, it will use
the value that was set by the EFI_MTFTP4_PROTOCOL.Configure()  function.

In "Status Codes Returned" table:

         EFI_INVALID_PARAMETER  One or more IPv4 addresses in OverrideData
are not valid unicast IPv4 addresses if OverrideData is not  NULL.

 

We'd better have specification to clarify this. At the same time, how about
you update your code to set a valid IP address so that to get the code
running first?

 

Thanks,

Ruth

From: Michael Lorer [ <mailto:[email protected]>
mailto:[email protected]] 
Sent: Wednesday, April 09, 2014 3:04 PM
To:  <mailto:[email protected]>
[email protected]
Subject: [edk2] MdeModulePkg maintainer: Possible bug in
Network/Mtftp4Dxe/Mtftp4Impl.c

 

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/Networ
k/Mtftp4Dxe/Mtftp4Impl.c#L187>
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/Networ
k/Mtftp4Dxe/Mtftp4Impl.c#L411>
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/Networ
k/Mtftp4Dxe/Mtftp4Impl.c#L196>
https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/Network
/Mtftp4Dxe/Mtftp4Impl.c#L196 

 

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

 

Regards,

Michael

 

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to