//\r
// Set the OpenData used to open the IpIo.\r
//\r
- CopyMem (&OpenData.IpConfigData, &mIpIoDefaultIpConfigData, sizeof (EFI_IP4_CONFIG_DATA));\r
+ CopyMem (&OpenData.IpConfigData, &mIpIoDefaultIpConfigData, sizeof (OpenData.IpConfigData));\r
OpenData.IpConfigData.AcceptBroadcast = TRUE;\r
OpenData.RcvdContext = (VOID *) Udp4Service;\r
OpenData.SndContext = NULL;\r
// Save the pointer to the UDP4_SERVICE_DATA, and initialize other members.\r
//\r
Instance->Udp4Service = Udp4Service;\r
- CopyMem (&Instance->Udp4Proto, &mUdp4Protocol, sizeof (EFI_UDP4_PROTOCOL));\r
+ CopyMem (&Instance->Udp4Proto, &mUdp4Protocol, sizeof (Instance->Udp4Proto));\r
Instance->IcmpError = EFI_SUCCESS;\r
Instance->Configured = FALSE;\r
Instance->IsNoMapping = FALSE;\r
continue;\r
}\r
\r
- if (EFI_IP4_EQUAL (ConfigData->StationAddress, *Address) &&\r
+ if (EFI_IP4_EQUAL (&ConfigData->StationAddress, Address) &&\r
(ConfigData->StationPort == Port)) {\r
//\r
// if both the address and the port are the same, return TRUE.\r
}\r
\r
if (!NewConfigData->UseDefaultAddress &&\r
- (!EFI_IP4_EQUAL (NewConfigData->StationAddress, OldConfigData->StationAddress) ||\r
- !EFI_IP4_EQUAL (NewConfigData->SubnetMask, OldConfigData->SubnetMask))) {\r
+ (!EFI_IP4_EQUAL (&NewConfigData->StationAddress, &OldConfigData->StationAddress) ||\r
+ !EFI_IP4_EQUAL (&NewConfigData->SubnetMask, &OldConfigData->SubnetMask))) {\r
//\r
// If the instance doesn't use the default address, and the new address or\r
// new subnet mask is different from the old values.\r
}\r
}\r
\r
- if (!EFI_IP4_EQUAL (NewConfigData->RemoteAddress, OldConfigData->RemoteAddress)) {\r
+ if (!EFI_IP4_EQUAL (&NewConfigData->RemoteAddress, &OldConfigData->RemoteAddress)) {\r
//\r
// The remoteaddress is not the same.\r
//\r
return FALSE;\r
}\r
\r
- if (!EFI_IP4_EQUAL (NewConfigData->RemoteAddress, mZeroIp4Addr) && (NewConfigData->RemotePort != OldConfigData->RemotePort)) {\r
+ if (!EFI_IP4_EQUAL (&NewConfigData->RemoteAddress, &mZeroIp4Addr) && (NewConfigData->RemotePort != OldConfigData->RemotePort)) {\r
//\r
// The RemotePort differs if it's designated in the configdata.\r
//\r
IN EFI_IP4_CONFIG_DATA *Ip4ConfigData\r
)\r
{\r
- CopyMem (Ip4ConfigData, &mIpIoDefaultIpConfigData, sizeof (EFI_IP4_CONFIG_DATA));\r
+ CopyMem (Ip4ConfigData, &mIpIoDefaultIpConfigData, sizeof (*Ip4ConfigData));\r
\r
Ip4ConfigData->DefaultProtocol = EFI_IP_PROTO_UDP;\r
Ip4ConfigData->AcceptBroadcast = Udp4ConfigData->AcceptBroadcast;\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- if (EFI_IP4_EQUAL (UdpSessionData->DestinationAddress, mZeroIp4Addr)) {\r
+ if (EFI_IP4_EQUAL (&UdpSessionData->DestinationAddress, &mZeroIp4Addr)) {\r
//\r
// The DestinationAddress specified in the UdpSessionData is 0.\r
//\r
return EFI_INVALID_PARAMETER;\r
}\r
- } else if (EFI_IP4_EQUAL (ConfigData->RemoteAddress, mZeroIp4Addr)) {\r
+ } else if (EFI_IP4_EQUAL (&ConfigData->RemoteAddress, &mZeroIp4Addr)) {\r
//\r
// the configured RemoteAddress is all zero, and the user doens't override the\r
// destination address.\r
\r
Checksum = NetAddChecksum (Checksum, HTONS ((UINT16) Packet->TotalSize));\r
\r
- return ~Checksum;\r
+ return (UINT16) ~Checksum;\r
}\r
\r
\r
\r
McastIp = Arg;\r
\r
- if ((McastIp != NULL) && (!EFI_IP4_EQUAL (*McastIp, (UINTN) Item->Key))) {\r
+ if ((McastIp != NULL) && (!EFI_IP4_EQUAL (McastIp, &(Item->Key)))) {\r
//\r
- // McastIp is not NULL and the multicast address contained in the Item \r
+ // McastIp is not NULL and the multicast address contained in the Item\r
// is not the same as McastIp.\r
//\r
return EFI_SUCCESS;\r
return FALSE;\r
}\r
\r
- if (!EFI_IP4_EQUAL (ConfigData->RemoteAddress, mZeroIp4Addr) &&\r
- !EFI_IP4_EQUAL (ConfigData->RemoteAddress, Udp4Session->SourceAddress)) {\r
+ if (!EFI_IP4_EQUAL (&ConfigData->RemoteAddress, &mZeroIp4Addr) &&\r
+ !EFI_IP4_EQUAL (&ConfigData->RemoteAddress, &Udp4Session->SourceAddress)) {\r
//\r
// This datagram doesn't come from the instance's specified sender.\r
//\r
return FALSE;\r
}\r
\r
- if (EFI_IP4_EQUAL (ConfigData->StationAddress, mZeroIp4Addr) ||\r
- EFI_IP4_EQUAL (Udp4Session->DestinationAddress, ConfigData->StationAddress)) {\r
+ if (EFI_IP4_EQUAL (&ConfigData->StationAddress, &mZeroIp4Addr) ||\r
+ EFI_IP4_EQUAL (&Udp4Session->DestinationAddress, &ConfigData->StationAddress)) {\r
//\r
// The instance is configured to receive datagrams destinated to any station IP or\r
// the destination address of this datagram matches the configured station IP.\r
\r
NetListInit (&Wrap->Link);\r
\r
- CopyMem (&Wrap->RxData, RxData, sizeof (EFI_UDP4_RECEIVE_DATA));\r
+ CopyMem (&Wrap->RxData, RxData, sizeof (Wrap->RxData));\r
\r
//\r
// Create the Recycle event.\r
//\r
// Wrap the RxData and put this Wrap into the instances RcvdDgramQue.\r
//\r
- CopyMem (&Wrap, Udp4WrapRxData (Instance, Packet, RxData), sizeof (UDP4_RXDATA_WRAP));\r
+ CopyMem (&Wrap, Udp4WrapRxData (Instance, Packet, RxData), sizeof (Wrap));\r
if (Wrap == NULL) {\r
continue;\r
}\r
//\r
// Calculate the checksum.\r
//\r
- IcmpErrHdr->Head.Checksum = ~(NetbufChecksum (Packet));\r
+ IcmpErrHdr->Head.Checksum = (UINT16) ~(NetbufChecksum (Packet));\r
\r
//\r
// Fill the override data.\r
if (!Instance->Configured ||\r
Instance->ConfigData.AcceptPromiscuous ||\r
Instance->ConfigData.AcceptAnyPort ||\r
- EFI_IP4_EQUAL (Instance->ConfigData.StationAddress, mZeroIp4Addr)) {\r
+ EFI_IP4_EQUAL (&Instance->ConfigData.StationAddress, &mZeroIp4Addr)) {\r
//\r
// Don't try to deliver the ICMP error to this instance if it is not configured,\r
// or it's configured to be promiscuous or accept any port or accept all the\r