diff options
Diffstat (limited to 'MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c')
-rw-r--r-- | MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c index 98df75df11..cc869717dd 100644 --- a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c +++ b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c @@ -29,6 +29,7 @@ Abstract: #include <Library/DebugLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/MemoryAllocationLib.h>
+#include <Library/BaseMemoryLib.h>
#define NET_PROTO_HDR(Buf, Type) ((Type *) ((Buf)->BlockOp[0].Head))
@@ -416,13 +417,13 @@ IpIoCreateSndEntry ( //
// Set the fields of OverrideData
//
- *OverrideData = * (EFI_IP4_OVERRIDE_DATA *) Override;
+ NetCopyMem (OverrideData, Override, sizeof (*OverrideData));
}
//
// Set the fields of TxData
//
- EFI_IP4 (TxData->DestinationAddress) = Dest;
+ NetCopyMem (&TxData->DestinationAddress, &Dest, sizeof (EFI_IPv4_ADDRESS));
TxData->OverrideData = OverrideData;
TxData->OptionsLength = 0;
TxData->OptionsBuffer = NULL;
@@ -761,7 +762,6 @@ IpIoOpen ( {
EFI_STATUS Status;
EFI_IP4_PROTOCOL *Ip;
- EFI_IPv4_ADDRESS ZeroIp;
if (IpIo->IsConfigured) {
return EFI_ACCESS_DENIED;
@@ -782,8 +782,7 @@ IpIoOpen ( // (0.0.0.0, 0.0.0.0, 0.0.0.0). Delete this statement if Ip modified
// its code
//
- EFI_IP4 (ZeroIp) = 0;
- Status = Ip->Routes (Ip, TRUE, &ZeroIp, &ZeroIp, &ZeroIp);
+ Status = Ip->Routes (Ip, TRUE, &mZeroIp4Addr, &mZeroIp4Addr, &mZeroIp4Addr);
if (EFI_ERROR (Status) && (EFI_NOT_FOUND != Status)) {
return Status;
@@ -1147,8 +1146,8 @@ IpIoConfigIp ( Ip4ConfigData->SubnetMask = Ip4ModeData.ConfigData.SubnetMask;
}
- IpInfo->Addr = EFI_IP4 (Ip4ConfigData->StationAddress);
- IpInfo->SubnetMask = EFI_IP4 (Ip4ConfigData->SubnetMask);
+ NetCopyMem (&IpInfo->Addr, &Ip4ConfigData->StationAddress, sizeof (IP4_ADDR));
+ NetCopyMem (&IpInfo->SubnetMask, &Ip4ConfigData->SubnetMask, sizeof (IP4_ADDR));
Status = Ip->Receive (Ip, &IpInfo->DummyRcvToken);
if (EFI_ERROR (Status)) {
|