diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-08-23 02:19:41 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-08-23 02:19:41 +0000 |
commit | 687a2e5f6902fa26c7a1d7a7705e0747c4095125 (patch) | |
tree | bcdcba327f17dd1fe3306d8ed04a98ca1e18f1cf /MdeModulePkg/Universal/Network | |
parent | 4a8f7cceccde9f40f55cae415e10d80906a84919 (diff) | |
download | edk2-platforms-687a2e5f6902fa26c7a1d7a7705e0747c4095125.tar.xz |
1. Enable Network stack to pass SCT, currently MNP, ARP, IP4, TCP4 and DHCP4 have passed SCT.
2. Enable Network stack to pass ICC build.
3. Sync Network library instances' module names with their filenames.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3692 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network')
45 files changed, 155 insertions, 148 deletions
diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c b/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c index 93b4c10200..b46c7047ee 100644 --- a/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c +++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c @@ -54,7 +54,7 @@ ArpInitInstance ( Instance->Signature = ARP_INSTANCE_DATA_SIGNATURE;
Instance->ArpService = ArpService;
- CopyMem (&Instance->ArpProto, &mEfiArpProtocolTemplate, sizeof (ARP_SERVICE_DATA));
+ CopyMem (&Instance->ArpProto, &mEfiArpProtocolTemplate, sizeof (Instance->ArpProto));
Instance->Configured = FALSE;
Instance->Destroyed = FALSE;
@@ -263,7 +263,9 @@ ArpOnFrameRcvd ( }
}
- NetListRemoveEntry (&CacheEntry->List);
+ if (!IsListEmpty (&CacheEntry->List)) {
+ NetListRemoveEntry (&CacheEntry->List);
+ }
//
// Fill the addresses into the CacheEntry.
@@ -912,7 +914,7 @@ ArpConfigureInstance ( //
// Save the configuration.
//
- CopyMem (OldConfigData, ConfigData, sizeof (EFI_ARP_CONFIG_DATA));
+ CopyMem (OldConfigData, ConfigData, sizeof (*OldConfigData));
OldConfigData->StationAddress = NetAllocatePool (OldConfigData->SwAddressLength);
if (OldConfigData->StationAddress == NULL) {
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c index 08d6076bda..b9f2704c00 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c @@ -36,7 +36,6 @@ EFI_SERVICE_BINDING_PROTOCOL mDhcp4ServiceBindingTemplete = { Dhcp4ServiceBindingDestroyChild
};
-//@MT: EFI_DRIVER_ENTRY_POINT (Dhcp4DriverEntryPoint)
EFI_STATUS
EFIAPI
@@ -250,7 +249,7 @@ Dhcp4CreateService ( DhcpSb->HwLen = (UINT8) DhcpSb->UdpIo->SnpMode.HwAddressSize;
DhcpSb->HwType = DhcpSb->UdpIo->SnpMode.IfType;
- CopyMem (&DhcpSb->Mac, &DhcpSb->UdpIo->SnpMode.CurrentAddress, sizeof (EFI_MAC_ADDRESS));
+ CopyMem (&DhcpSb->Mac, &DhcpSb->UdpIo->SnpMode.CurrentAddress, sizeof (DhcpSb->Mac));
*Service = DhcpSb;
return EFI_SUCCESS;
@@ -454,7 +453,7 @@ DhcpInitProtocol ( )
{
Instance->Signature = DHCP_PROTOCOL_SIGNATURE;
- CopyMem (&Instance->Dhcp4Protocol, &mDhcp4ProtocolTemplate, sizeof (EFI_DHCP4_PROTOCOL));
+ CopyMem (&Instance->Dhcp4Protocol, &mDhcp4ProtocolTemplate, sizeof (Instance->Dhcp4Protocol));
NetListInit (&Instance->Link);
Instance->Handle = NULL;
Instance->Service = DhcpSb;
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c index 68da959466..3595e784a0 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c @@ -69,9 +69,9 @@ EfiDhcp4GetModeData ( // Caller can use GetModeData to retrieve current DHCP states
// no matter whether it is the active child or not.
//
- Dhcp4ModeData->State = DhcpSb->DhcpState;
- CopyMem (&Dhcp4ModeData->ConfigData, &DhcpSb->ActiveConfig, sizeof (EFI_DHCP4_CONFIG_DATA));
- CopyMem (&Dhcp4ModeData->ClientMacAddress, &DhcpSb->Mac, sizeof (EFI_MAC_ADDRESS));
+ Dhcp4ModeData->State = (EFI_DHCP4_STATE) DhcpSb->DhcpState;
+ CopyMem (&Dhcp4ModeData->ConfigData, &DhcpSb->ActiveConfig, sizeof (Dhcp4ModeData->ConfigData));
+ CopyMem (&Dhcp4ModeData->ClientMacAddress, &DhcpSb->Mac, sizeof (Dhcp4ModeData->ClientMacAddress));
Ip = HTONL (DhcpSb->ClientAddr);
NetCopyMem (&Dhcp4ModeData->ClientAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
@@ -161,7 +161,7 @@ DhcpCopyConfigure ( INTN Len;
UINT32 Index;
- CopyMem (Dst, Src, sizeof (EFI_DHCP4_CONFIG_DATA));
+ CopyMem (Dst, Src, sizeof (Dst));
Dst->DiscoverTimeout = NULL;
Dst->RequestTimeout = NULL;
Dst->OptionList = NULL;
@@ -250,9 +250,7 @@ DhcpYieldControl ( )
{
EFI_DHCP4_CONFIG_DATA *Config;
- DHCP_PROTOCOL *Instance;
- Instance = DhcpSb->ActiveChild;
Config = &DhcpSb->ActiveConfig;
DhcpSb->ServiceState = DHCP_UNCONFIGED;
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h index 7f449415d2..d81d68fa1e 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.h @@ -61,10 +61,10 @@ enum { // DHCP_UNCONFIGED = 0, DHCP_CONFIGED, - DHCP_DESTORY, + DHCP_DESTORY }; -typedef struct _DHCP_PROTOCOL { +struct _DHCP_PROTOCOL { UINT32 Signature; EFI_DHCP4_PROTOCOL Dhcp4Protocol; NET_LIST_ENTRY Link; @@ -83,7 +83,7 @@ typedef struct _DHCP_PROTOCOL { // DHCP driver is specical in that it is a singleton. Although it // has a service binding, there can be only one active child. // -typedef struct _DHCP_SERVICE { +struct _DHCP_SERVICE { UINT32 Signature; EFI_SERVICE_BINDING_PROTOCOL ServiceBinding; diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c index e0fdcd382c..41554393a5 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c @@ -120,7 +120,7 @@ DhcpCallUser ( Status = Config->Dhcp4Callback (
&DhcpSb->ActiveChild->Dhcp4Protocol,
Config->CallbackContext,
- DhcpSb->DhcpState,
+ (EFI_DHCP4_STATE) DhcpSb->DhcpState,
Event,
Packet,
NewPacket
@@ -948,7 +948,7 @@ DhcpHandleReboot ( }
DhcpSb->Selected = Packet;
- CopyMem (DhcpSb->Para, Para, sizeof (DHCP_PARAMETER));
+ CopyMem (DhcpSb->Para, Para, sizeof (*DhcpSb->Para));
Status = DhcpLeaseAcquired (DhcpSb);
@@ -1214,7 +1214,7 @@ DhcpSendMessage ( Len = sizeof (EFI_DHCP4_PACKET) + 128 + DhcpSb->UserOptionLen;
if (Msg != NULL) {
- Len += (UINT32)AsciiStrLen (Msg);
+ Len += (UINT32)AsciiStrLen ((CHAR8 *) Msg);
}
Packet = NetAllocatePool (Len);
@@ -1310,7 +1310,7 @@ DhcpSendMessage ( // Append the user's message if it isn't NULL
//
if (Msg != NULL) {
- Len = NET_MIN ((UINT32) AsciiStrLen (Msg), 255);
+ Len = NET_MIN ((UINT32) AsciiStrLen ((CHAR8 *) Msg), 255);
Buf = DhcpAppendOption (Buf, DHCP_TAG_MESSAGE, (UINT16) Len, Msg);
}
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.h b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.h index 1da95f94a7..a05b66282e 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.h +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.h @@ -63,7 +63,7 @@ enum { // DHCP_NOTIFY_COMPLETION = 1, DHCP_NOTIFY_RENEWREBIND, - DHCP_NOTIFY_ALL, + DHCP_NOTIFY_ALL }; #define DHCP_IS_BOOTP(Parameter) (((Parameter) == NULL) || ((Parameter)->DhcpType == 0)) diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c index b16f4693d7..cf43dfa206 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c @@ -424,7 +424,7 @@ DhcpIterateOptions ( if ((Overload == DHCP_OVERLOAD_FILENAME) || (Overload == DHCP_OVERLOAD_BOTH)) {
Status = DhcpIterateBufferOptions (
- Packet->Dhcp4.Header.BootFileName,
+ (UINT8 *) Packet->Dhcp4.Header.BootFileName,
128,
Check,
Context,
@@ -438,7 +438,7 @@ DhcpIterateOptions ( if ((Overload == DHCP_OVERLOAD_SVRNAME) || (Overload == DHCP_OVERLOAD_BOTH)) {
Status = DhcpIterateBufferOptions (
- Packet->Dhcp4.Header.ServerName,
+ (UINT8 *) Packet->Dhcp4.Header.ServerName,
64,
Check,
Context,
@@ -480,7 +480,7 @@ DhcpGetOptionLen ( DHCP_OPTION_COUNT *OpCount;
OpCount = (DHCP_OPTION_COUNT *) Context;
- OpCount[Tag].Offset = OpCount[Tag].Offset + Len;
+ OpCount[Tag].Offset = (UINT16) (OpCount[Tag].Offset + Len);
return EFI_SUCCESS;
}
@@ -528,8 +528,8 @@ DhcpFillOption ( NetCopyMem (Buf + OptCount[Tag].Offset, Data, Len);
- OptCount[Tag].Offset = OptCount[Tag].Offset + Len;
- Options[Index].Len = Options[Index].Len + Len;
+ OptCount[Tag].Offset = (UINT16) (OptCount[Tag].Offset + Len);
+ Options[Index].Len = (UINT16) (Options[Index].Len + Len);
return EFI_SUCCESS;
}
@@ -606,8 +606,8 @@ DhcpParseOption ( if (OptCount[Index].Offset != 0) {
OptCount[Index].Index = (UINT8) OptNum;
- TotalLen = TotalLen + OptCount[Index].Offset;
- OptCount[Index].Offset = TotalLen - OptCount[Index].Offset;
+ TotalLen = (UINT16) (TotalLen + OptCount[Index].Offset);
+ OptCount[Index].Offset = (UINT16) (TotalLen - OptCount[Index].Offset);
OptNum++;
}
@@ -727,7 +727,7 @@ DhcpValidateOptions ( goto ON_EXIT;
}
- CopyMem (*Para, &Parameter, sizeof (DHCP_PARAMETER));
+ CopyMem (*Para, &Parameter, sizeof (**Para));
}
ON_EXIT:
@@ -879,7 +879,7 @@ DhcpBuild ( Packet->Size = Len;
Packet->Length = 0;
- CopyMem (&Packet->Dhcp4.Header, &SeedPacket->Dhcp4.Header, sizeof (EFI_DHCP4_HEADER));
+ CopyMem (&Packet->Dhcp4.Header, &SeedPacket->Dhcp4.Header, sizeof (Packet->Dhcp4.Header));
Packet->Dhcp4.Magik = DHCP_OPTION_MAGIC;
Buf = Packet->Dhcp4.Option;
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.h b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.h index a6a485bece..4bc1920eb3 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.h +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.h @@ -131,7 +131,7 @@ enum { DHCP_TAG_T1 = 58, // Renewal (T1) Time Value DHCP_TAG_T2 = 59, // Rebinding (T2) Time Value DHCP_TAG_VENDOR_CLASS = 60, // Vendor class identifier - DHCP_TAG_CLIENT_ID = 61, // Client-identifier + DHCP_TAG_CLIENT_ID = 61 // Client-identifier }; enum { @@ -153,7 +153,7 @@ enum { // DHCP_OVERLOAD_FILENAME = 1, DHCP_OVERLOAD_SVRNAME = 2, - DHCP_OVERLOAD_BOTH = 3, + DHCP_OVERLOAD_BOTH = 3 }; // diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c index a1bae0f29d..ee78ceea6c 100644 --- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c +++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c @@ -66,7 +66,7 @@ EfiNicIp4ConfigGetName ( }
if (NicAddr != NULL) {
- CopyMem (NicAddr, &Instance->NicAddr, sizeof (NIC_ADDR));
+ CopyMem (NicAddr, &Instance->NicAddr, sizeof (*NicAddr));
}
return EFI_SUCCESS;
@@ -630,7 +630,7 @@ Ip4ConfigOnDhcp4Complete ( goto ON_EXIT;
}
- CopyMem (&Instance->NicConfig->NicAddr, &Instance->NicAddr, sizeof (NIC_ADDR));
+ CopyMem (&Instance->NicConfig->NicAddr, &Instance->NicAddr, sizeof (Instance->NicConfig->NicAddr));
Instance->NicConfig->Source = IP4_CONFIG_SOURCE_DHCP;
Instance->NicConfig->Perment = Perment;
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c index 3d857b047e..dd103bc908 100644 --- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c +++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c @@ -251,7 +251,7 @@ Ip4ConfigDriverBindingStart ( Instance->NicAddr.Type = (UINT16) SnpMode.IfType;
Instance->NicAddr.Len = (UINT8) SnpMode.HwAddressSize;
- CopyMem (&Instance->NicAddr.MacAddr, &SnpMode.CurrentAddress, sizeof (EFI_MAC_ADDRESS));
+ CopyMem (&Instance->NicAddr.MacAddr, &SnpMode.CurrentAddress, sizeof (Instance->NicAddr.MacAddr));
//
// Add it to the global list, and compose the name
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h index 59e5c11786..4c5a7b4079 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h @@ -58,7 +58,7 @@ enum { // IP4_HEAD_DF_MASK = 0x4000, IP4_HEAD_MF_MASK = 0x2000, - IP4_HEAD_OFFSET_MASK = 0x1fff, + IP4_HEAD_OFFSET_MASK = 0x1fff }; #define IP4_ALLZERO_ADDRESS 0x00000000u diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c index 7f29c90869..14188851b4 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c @@ -251,7 +251,7 @@ Ip4IcmpReplyEcho ( Icmp = (IP4_ICMP_QUERY_HEAD *) NetbufGetByte (Data, 0, NULL);
Icmp->Head.Type = ICMP_ECHO_REPLY;
Icmp->Head.Checksum = 0;
- Icmp->Head.Checksum = ~NetblockChecksum ((UINT8 *) Icmp, Data->TotalSize);
+ Icmp->Head.Checksum = (UINT16) (~NetblockChecksum ((UINT8 *) Icmp, Data->TotalSize));
ReplyHead.Tos = 0;
ReplyHead.Fragment = 0;
@@ -353,7 +353,7 @@ Ip4IcmpHandle ( goto DROP;
}
- Checksum = ~NetbufChecksum (Packet);
+ Checksum = (UINT16) (~NetbufChecksum (Packet));
if ((Icmp.Checksum != 0) && (Checksum != 0)) {
goto DROP;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.h index f4641e2ef6..366b02c176 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.h @@ -79,7 +79,7 @@ enum { // ICMP_INVALID_MESSAGE = 0, ICMP_ERROR_MESSAGE = 1, - ICMP_QUERY_MESSAGE = 2, + ICMP_QUERY_MESSAGE = 2 }; typedef struct { diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c index 952eb98ccc..bfb9616c2d 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c @@ -108,8 +108,8 @@ Ip4WrapLinkTxToken ( Token->CallBack = CallBack;
Token->Packet = Packet;
Token->Context = Context;
- CopyMem (&Token->DstMac, &mZeroMacAddress, sizeof (EFI_MAC_ADDRESS));
- CopyMem (&Token->SrcMac, &Interface->Mac, sizeof (EFI_MAC_ADDRESS));
+ CopyMem (&Token->DstMac, &mZeroMacAddress, sizeof (Token->DstMac));
+ CopyMem (&Token->SrcMac, &Interface->Mac, sizeof (Token->SrcMac));
MnpToken = &(Token->MnpToken);
MnpToken->Status = EFI_NOT_READY;
@@ -213,7 +213,7 @@ Ip4CreateArpQue ( }
ArpQue->Ip = DestIp;
- CopyMem (&ArpQue->Mac, &mZeroMacAddress, sizeof (EFI_MAC_ADDRESS));
+ CopyMem (&ArpQue->Mac, &mZeroMacAddress, sizeof (ArpQue->Mac));
return ArpQue;
}
@@ -485,8 +485,8 @@ Ip4CreateInterface ( return NULL;
}
- CopyMem (&Interface->Mac, &SnpMode.CurrentAddress, sizeof (EFI_MAC_ADDRESS));
- CopyMem (&Interface->BroadcastMac, &SnpMode.BroadcastAddress, sizeof (EFI_MAC_ADDRESS));
+ CopyMem (&Interface->Mac, &SnpMode.CurrentAddress, sizeof (Interface->Mac));
+ CopyMem (&Interface->BroadcastMac, &SnpMode.BroadcastAddress, sizeof (Interface->BroadcastMac));
Interface->HwaddrLen = SnpMode.HwAddressSize;
NetListInit (&Interface->IpInstances);
@@ -796,7 +796,7 @@ Ip4OnArpResolved ( NetListRemoveEntry (Entry);
Token = NET_LIST_USER_STRUCT (Entry, IP4_LINK_TX_TOKEN, Link);
- CopyMem (&Token->DstMac, &ArpQue->Mac, sizeof (EFI_MAC_ADDRESS));
+ CopyMem (&Token->DstMac, &ArpQue->Mac, sizeof (Token->DstMac));
Status = Interface->Mnp->Transmit (Interface->Mnp, &Token->MnpToken);
@@ -904,7 +904,7 @@ Ip4SendFrame ( // all the broadcasts.
//
if (NextHop == IP4_ALLONE_ADDRESS) {
- CopyMem (&Token->DstMac, &Interface->BroadcastMac, sizeof (EFI_MAC_ADDRESS));
+ CopyMem (&Token->DstMac, &Interface->BroadcastMac, sizeof (Token->DstMac));
goto SEND_NOW;
} else if (IP4_IS_MULTICAST (NextHop)) {
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h index a324c82430..9db1d8ac79 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h @@ -28,7 +28,7 @@ enum { IP4_FRAME_RX_SIGNATURE = EFI_SIGNATURE_32 ('I', 'P', 'F', 'R'), IP4_FRAME_TX_SIGNATURE = EFI_SIGNATURE_32 ('I', 'P', 'F', 'T'), IP4_FRAME_ARP_SIGNATURE = EFI_SIGNATURE_32 ('I', 'P', 'F', 'A'), - IP4_INTERFACE_SIGNATURE = EFI_SIGNATURE_32 ('I', 'P', 'I', 'F'), + IP4_INTERFACE_SIGNATURE = EFI_SIGNATURE_32 ('I', 'P', 'I', 'F') }; // @@ -134,7 +134,7 @@ BOOLEAN // Notice the special cases that DHCP can configure the interface // with 0.0.0.0/0.0.0.0. // -typedef struct _IP4_INTERFACE { +struct _IP4_INTERFACE { UINT32 Signature; NET_LIST_ENTRY Link; INTN RefCnt; @@ -182,7 +182,7 @@ typedef struct _IP4_INTERFACE { // NET_LIST_ENTRY IpInstances; BOOLEAN PromiscRecv; -} IP4_INTERFACE; +}; IP4_INTERFACE * Ip4CreateInterface ( diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.c index 135efa62ce..6609b1334d 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.c @@ -206,7 +206,7 @@ Ip4SendIgmpMessage ( Igmp->MaxRespTime = 0;
Igmp->Checksum = 0;
Igmp->Group = HTONL (Group);
- Igmp->Checksum = ~NetblockChecksum ((UINT8 *) Igmp, sizeof (IGMP_HEAD));
+ Igmp->Checksum = (UINT16) (~NetblockChecksum ((UINT8 *) Igmp, sizeof (IGMP_HEAD)));
Head.Tos = 0;
Head.Protocol = IP4_PROTO_IGMP;
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h index f7cb92c23f..9bda9f942b 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h @@ -66,7 +66,7 @@ enum { IGMP_LEAVE_GROUP = 0x17, IGMP_V1ROUTER_PRESENT = 400, - IGMP_UNSOLICIATED_REPORT = 10, + IGMP_UNSOLICIATED_REPORT = 10 }; EFI_STATUS diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c index 824524d508..e617d3de80 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c @@ -67,7 +67,7 @@ EfiIp4GetModeData ( // IsConfigured is "whether the station address has been configured"
//
Ip4ModeData->IsStarted = (BOOLEAN)(IpInstance->State == IP4_STATE_CONFIGED);
- CopyMem (&Ip4ModeData->ConfigData, &IpInstance->ConfigData, sizeof (EFI_IP4_CONFIG_DATA));
+ CopyMem (&Ip4ModeData->ConfigData, &IpInstance->ConfigData, sizeof (Ip4ModeData->ConfigData));
Ip4ModeData->IsConfigured = FALSE;
Ip4ModeData->GroupCount = IpInstance->GroupCount;
@@ -112,11 +112,11 @@ EfiIp4GetModeData ( }
if (MnpConfigData != NULL) {
- CopyMem (MnpConfigData, &IpSb->MnpConfigData, sizeof (EFI_MANAGED_NETWORK_CONFIG_DATA));
+ CopyMem (MnpConfigData, &IpSb->MnpConfigData, sizeof (*MnpConfigData));
}
if (SnpModeData != NULL) {
- CopyMem (SnpModeData, &IpSb->SnpMode, sizeof (EFI_SIMPLE_NETWORK_MODE));
+ CopyMem (SnpModeData, &IpSb->SnpMode, sizeof (*SnpModeData));
}
NET_RESTORE_TPL (OldTpl);
@@ -197,7 +197,7 @@ Ip4ServiceConfigMnp ( // recover the original configuration if failed to set the configure.
//
if (EFI_ERROR (Status) && Reconfig) {
- IpSb->MnpConfigData.EnablePromiscuousReceive = !PromiscReceive;
+ IpSb->MnpConfigData.EnablePromiscuousReceive = (BOOLEAN) !PromiscReceive;
}
return Status;
@@ -477,7 +477,7 @@ Ip4InitProtocol ( NetZeroMem (IpInstance, sizeof (IP4_PROTOCOL));
IpInstance->Signature = IP4_PROTOCOL_SIGNATURE;
- CopyMem (&IpInstance->Ip4Proto, &mEfiIp4ProtocolTemplete, sizeof (EFI_IP4_PROTOCOL));
+ CopyMem (&IpInstance->Ip4Proto, &mEfiIp4ProtocolTemplete, sizeof (IpInstance->Ip4Proto));
IpInstance->State = IP4_STATE_UNCONFIGED;
IpInstance->Service = IpSb;
@@ -538,7 +538,7 @@ Ip4ConfigProtocol ( return EFI_DEVICE_ERROR;
}
- CopyMem (&IpInstance->ConfigData, Config, sizeof (EFI_IP4_CONFIG_DATA));
+ CopyMem (&IpInstance->ConfigData, Config, sizeof (IpInstance->ConfigData));
return EFI_SUCCESS;
}
@@ -627,7 +627,7 @@ Ip4ConfigProtocol ( IpInstance->Interface = IpIf;
NetListInsertTail (&IpIf->IpInstances, &IpInstance->AddrLink);
- CopyMem (&IpInstance->ConfigData, Config, sizeof (EFI_IP4_CONFIG_DATA));
+ CopyMem (&IpInstance->ConfigData, Config, sizeof (IpInstance->ConfigData));
IpInstance->State = IP4_STATE_CONFIGED;
//
@@ -1616,7 +1616,6 @@ EfiIp4Receive ( )
{
IP4_PROTOCOL *IpInstance;
- EFI_IP4_CONFIG_DATA *Config;
EFI_STATUS Status;
EFI_TPL OldTpl;
@@ -1636,8 +1635,6 @@ EfiIp4Receive ( goto ON_EXIT;
}
- Config = &IpInstance->ConfigData;
-
//
// Current Udp implementation creates an IP child for each Udp child.
// It initates a asynchronous receive immediately no matter whether
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h index 1bbee93237..58bf045372 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h @@ -40,15 +40,15 @@ Abstract: #include <Library/BaseMemoryLib.h> #include <Library/MemoryAllocationLib.h> -#include "IP4Common.h" -#include "IP4Driver.h" -#include "IP4If.h" +#include "Ip4Common.h" +#include "Ip4Driver.h" +#include "Ip4If.h" #include "Ip4Icmp.h" -#include "IP4Option.h" +#include "Ip4Option.h" #include "Ip4Igmp.h" -#include "IP4Route.h" -#include "IP4Input.h" -#include "IP4Output.h" +#include "Ip4Route.h" +#include "Ip4Input.h" +#include "Ip4Output.h" enum { IP4_PROTOCOL_SIGNATURE = EFI_SIGNATURE_32 ('I', 'P', '4', 'P'), @@ -73,7 +73,7 @@ enum { IP4_SERVICE_UNSTARTED = 0, IP4_SERVICE_STARTED, IP4_SERVICE_CONFIGED, - IP4_SERVICE_DESTORY, + IP4_SERVICE_DESTORY }; // @@ -109,7 +109,7 @@ typedef struct { EFI_IP4_RECEIVE_DATA RxData; } IP4_RXDATA_WRAP; -typedef struct _IP4_PROTOCOL { +struct _IP4_PROTOCOL { UINT32 Signature; EFI_IP4_PROTOCOL Ip4Proto; @@ -148,9 +148,9 @@ typedef struct _IP4_PROTOCOL { EFI_IP4_CONFIG_DATA ConfigData; -} IP4_PROTOCOL; +}; -typedef struct _IP4_SERVICE { +struct _IP4_SERVICE { UINT32 Signature; EFI_SERVICE_BINDING_PROTOCOL ServiceBinding; INTN State; @@ -200,7 +200,7 @@ typedef struct _IP4_SERVICE { // NIC this IP4_SERVICE works on. // CHAR16 *MacString; -} IP4_SERVICE; +}; #define IP4_INSTANCE_FROM_PROTOCOL(Ip4) \ CR ((Ip4), IP4_PROTOCOL, Ip4Proto, IP4_PROTOCOL_SIGNATURE) diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c index f5c4c9e1d4..5ed1ec79f0 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c @@ -435,7 +435,7 @@ Ip4Reassemble ( }
NewPacket->Ip = Assemble->Head;
- CopyMem (IP4_GET_CLIP_INFO (NewPacket), Assemble->Info, sizeof (IP4_CLIP_INFO));
+ CopyMem (IP4_GET_CLIP_INFO (NewPacket), Assemble->Info, sizeof (*IP4_GET_CLIP_INFO (NewPacket)));
return NewPacket;
}
@@ -511,7 +511,7 @@ Ip4AccpetFrame ( //
// Some OS may send IP packets without checksum.
//
- Checksum = ~NetblockChecksum ((UINT8 *) Head, HeadLen);
+ Checksum = (UINT16) (~NetblockChecksum ((UINT8 *) Head, HeadLen));
if ((Head->Checksum != 0) && (Checksum != 0)) {
goto RESTART;
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h index 9a3af8fba7..2acf769968 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h @@ -27,7 +27,7 @@ enum { IP4_ASSEMLE_HASH_SIZE = 31, IP4_FRAGMENT_LIFE = 120, - IP4_MAX_PACKET_SIZE = 65535, + IP4_MAX_PACKET_SIZE = 65535 }; // diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c index e1f059e89f..322166f657 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c @@ -47,9 +47,9 @@ Ip4OptionIsValid ( UINT32 Cur;
UINT32 Len;
UINT32 Point;
- UINT8 IcmpType;
- UINT8 IcmpCode;
- UINT32 IcmpPoint;
+ volatile UINT8 IcmpType;
+ volatile UINT8 IcmpCode;
+ volatile UINT32 IcmpPoint;
IcmpType = ICMP_PARAMETER_PROBLEM;
IcmpCode = 0;
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.h index 6af885f25b..665b55b06a 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.h @@ -31,7 +31,7 @@ enum { IP4_OPTION_SSRR = 137, // Strict source and record routing, 10001001 IP4_OPTION_RR = 7, // Record routing, 00000111 - IP4_OPTION_COPY_MASK = 0x80, + IP4_OPTION_COPY_MASK = 0x80 }; BOOLEAN diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c index d595ab2999..0232bfedda 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c @@ -89,7 +89,7 @@ Ip4PrependHead ( PacketHead->Protocol = Head->Protocol;
PacketHead->Src = HTONL (Head->Src);
PacketHead->Dst = HTONL (Head->Dst);
- PacketHead->Checksum = ~NetblockChecksum ((UINT8 *) PacketHead, HeadLen);
+ PacketHead->Checksum = (UINT16) (~NetblockChecksum ((UINT8 *) PacketHead, HeadLen));
Packet->Ip = PacketHead;
return EFI_SUCCESS;
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c index 2cf1d0f29c..54d934250f 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c @@ -628,7 +628,6 @@ Ip4BuildEfiRouteTable ( IN IP4_PROTOCOL *IpInstance
)
{
- IP4_SERVICE *IpSb;
NET_LIST_ENTRY *Entry;
IP4_ROUTE_TABLE *RtTable;
IP4_ROUTE_ENTRY *RtEntry;
@@ -636,7 +635,6 @@ Ip4BuildEfiRouteTable ( UINT32 Count;
INT32 Index;
- IpSb = IpInstance->Service;
RtTable = IpInstance->RouteTable;
if (IpInstance->EfiRouteTable != NULL) {
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h index ce07b1d10c..3dce5d2f3a 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h @@ -30,7 +30,7 @@ enum { IP4_DIRECT_ROUTE = 0x00000001, IP4_ROUTE_CACHE_HASH = 31, - IP4_ROUTE_CACHE_MAX = 64, // Max NO. of cache entry per hash bucket + IP4_ROUTE_CACHE_MAX = 64 // Max NO. of cache entry per hash bucket }; #define IP4_ROUTE_CACHE_HASH(Dst, Src) (((Dst) ^ (Src)) % IP4_ROUTE_CACHE_HASH) @@ -91,7 +91,7 @@ typedef struct { // typedef struct _IP4_ROUTE_TABLE IP4_ROUTE_TABLE; -typedef struct _IP4_ROUTE_TABLE { +struct _IP4_ROUTE_TABLE { INTN RefCnt; UINT32 TotalNum; NET_LIST_ENTRY RouteArea[IP4_MASK_NUM]; diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpConfig.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpConfig.c index 83fc3c6ae4..88158ea50b 100644 --- a/MdeModulePkg/Universal/Network/MnpDxe/MnpConfig.c +++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpConfig.c @@ -537,12 +537,12 @@ MnpInitializeInstanceData ( //
// Copy the MNP Protocol interfaces from the template.
//
- CopyMem (&Instance->ManagedNetwork, &mMnpProtocolTemplate, sizeof (EFI_MANAGED_NETWORK_PROTOCOL));
+ CopyMem (&Instance->ManagedNetwork, &mMnpProtocolTemplate, sizeof (Instance->ManagedNetwork));
//
// Copy the default config data.
//
- CopyMem (&Instance->ConfigData, &mMnpDefaultConfigData, sizeof (EFI_MANAGED_NETWORK_CONFIG_DATA));
+ CopyMem (&Instance->ConfigData, &mMnpDefaultConfigData, sizeof (Instance->ConfigData));
//
// Initialize the lists.
@@ -1038,7 +1038,7 @@ MnpConfigureInstance ( //
// Save the new configuration data.
//
- CopyMem (OldConfigData, NewConfigData, sizeof (EFI_MANAGED_NETWORK_CONFIG_DATA));
+ CopyMem (OldConfigData, NewConfigData, sizeof (*OldConfigData));
Instance->Configured = (BOOLEAN) (ConfigData != NULL);
@@ -1152,7 +1152,7 @@ MnpConfigReceiveFilters ( NET_LIST_FOR_EACH (Entry, &MnpServiceData->GroupAddressList) {
GroupAddress = NET_LIST_USER_STRUCT (Entry, MNP_GROUP_ADDRESS, AddrEntry);
- CopyMem (MCastFilter + Index, &GroupAddress->Address, sizeof (EFI_MAC_ADDRESS));
+ CopyMem (MCastFilter + Index, &GroupAddress->Address, sizeof (*(MCastFilter + Index)));
Index++;
ASSERT (Index <= MCastFilterCnt);
@@ -1266,7 +1266,7 @@ MnpGroupOpAddCtrlBlk ( return EFI_OUT_OF_RESOURCES;
}
- CopyMem (&GroupAddress->Address, MacAddress, sizeof (EFI_MAC_ADDRESS));
+ CopyMem (&GroupAddress->Address, MacAddress, sizeof (GroupAddress->Address));
GroupAddress->RefCnt = 0;
NetListInsertTail (
&MnpServiceData->GroupAddressList,
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c index aafc8433a5..c1529d2620 100644 --- a/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c +++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c @@ -747,7 +747,7 @@ MnpWrapRxData ( //
// Fill the RxData in RxDataWrap,
//
- CopyMem (&RxDataWrap->RxData, RxData, sizeof (EFI_MANAGED_NETWORK_RECEIVE_DATA));
+ CopyMem (&RxDataWrap->RxData, RxData, sizeof (RxDataWrap->RxData));
//
// Create the recycle event.
@@ -827,7 +827,7 @@ MnpEnqueuePacket ( //
// Wrap the RxData.
//
- CopyMem (&RxDataWrap, MnpWrapRxData (Instance, &RxData), sizeof (MNP_RXDATA_WRAP));
+ RxDataWrap = MnpWrapRxData (Instance, &RxData);
if (RxDataWrap == NULL) {
continue;
}
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c index ccd82d0e87..04e437e939 100644 --- a/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c +++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c @@ -68,7 +68,7 @@ MnpGetModeData ( //
// Copy the instance configuration data.
//
- CopyMem (MnpConfigData, &Instance->ConfigData, sizeof (EFI_MANAGED_NETWORK_CONFIG_DATA));
+ CopyMem (MnpConfigData, &Instance->ConfigData, sizeof (*MnpConfigData));
}
if (SnpModeData != NULL) {
@@ -76,7 +76,7 @@ MnpGetModeData ( // Copy the underlayer Snp mode data.
//
Snp = Instance->MnpServiceData->Snp;
- CopyMem (SnpModeData, Snp->Mode, sizeof (EFI_SIMPLE_NETWORK_MODE));
+ CopyMem (SnpModeData, Snp->Mode, sizeof (*SnpModeData));
}
if (!Instance->Configured) {
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c index 9b30b3d730..5a15f9a6f1 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c @@ -34,8 +34,6 @@ EFI_SERVICE_BINDING_PROTOCOL gMtftp4ServiceBindingTemplete = { Mtftp4ServiceBindingDestroyChild
};
-//@MT: EFI_DRIVER_ENTRY_POINT (Mtftp4DriverEntryPoint)
-
EFI_STATUS
EFIAPI
Mtftp4DriverEntryPoint (
@@ -429,7 +427,7 @@ Mtftp4InitProtocol ( Instance->Signature = MTFTP4_PROTOCOL_SIGNATURE;
NetListInit (&Instance->Link);
- CopyMem (&Instance->Mtftp4, &gMtftp4ProtocolTemplate, sizeof (EFI_MTFTP4_PROTOCOL));
+ CopyMem (&Instance->Mtftp4, &gMtftp4ProtocolTemplate, sizeof (Instance->Mtftp4));
Instance->State = MTFTP4_STATE_UNCONFIGED;
Instance->Indestory = FALSE;
Instance->Service = MtftpSb;
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h index 9bf5bd59f7..22ba7dd705 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h @@ -61,10 +61,10 @@ enum { MTFTP4_STATE_UNCONFIGED = 0, MTFTP4_STATE_CONFIGED, - MTFTP4_STATE_DESTORY, + MTFTP4_STATE_DESTORY }; -typedef struct _MTFTP4_SERVICE { +struct _MTFTP4_SERVICE { UINT32 Signature; EFI_SERVICE_BINDING_PROTOCOL ServiceBinding; @@ -92,7 +92,7 @@ typedef struct { EFI_STATUS Status; } MTFTP4_GETINFO_STATE; -typedef struct _MTFTP4_PROTOCOL { +struct _MTFTP4_PROTOCOL { UINT32 Signature; NET_LIST_ENTRY Link; EFI_MTFTP4_PROTOCOL Mtftp4; diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.h b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.h index a136304df4..3bd7574eb2 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.h +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.h @@ -33,7 +33,7 @@ enum { MTFTP4_BLKSIZE_EXIST = 0x01, MTFTP4_TIMEOUT_EXIST = 0x02, MTFTP4_TSIZE_EXIST = 0x04, - MTFTP4_MCAST_EXIST = 0x08, + MTFTP4_MCAST_EXIST = 0x08 }; typedef struct { diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c index af61c0bf69..903494ecb7 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c @@ -229,7 +229,7 @@ Mtftp4RemoveBlockNum ( if (Range->End == Num) {
Range->End--;
} else {
- NewRange = Mtftp4AllocateRange (Num + 1, (UINT16) Range->End);
+ NewRange = Mtftp4AllocateRange ((UINT16) (Num + 1), (UINT16) Range->End);
if (NewRange == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -270,6 +270,8 @@ Mtftp4SendRequest ( UINT8 *Cur;
UINT32 Len;
UINTN Index;
+ UINT32 Len1;
+ UINT32 Len2;
Token = Instance->Token;
Options = Token->OptionList;
@@ -282,11 +284,14 @@ Mtftp4SendRequest ( //
// Compute the packet length
//
- Len = (UINT32) (AsciiStrLen (Token->Filename) + AsciiStrLen (Mode) + 4);
+ Len1 = (UINT32) AsciiStrLen ((CHAR8 *) Token->Filename);
+ Len2 = (UINT32) AsciiStrLen ((CHAR8 *) Mode);
+ Len = (Len1 + Len2 + 4);
for (Index = 0; Index < Token->OptionCount; Index++) {
- Len += (UINT32) (AsciiStrLen (Options[Index].OptionStr) +
- AsciiStrLen (Options[Index].ValueStr) + 2);
+ Len1 = (UINT32) AsciiStrLen ((CHAR8 *) Options[Index].OptionStr);
+ Len2 = (UINT32) AsciiStrLen ((CHAR8 *) Options[Index].ValueStr);
+ Len += Len1 + Len2 + 2;
}
//
@@ -299,12 +304,12 @@ Mtftp4SendRequest ( Packet = (EFI_MTFTP4_PACKET *) NetbufAllocSpace (Nbuf, Len, FALSE);
Packet->OpCode = HTONS (Instance->Operation);
Cur = Packet->Rrq.Filename;
- Cur = AsciiStrCpy (Cur, Token->Filename);
- Cur = AsciiStrCpy (Cur, Mode);
+ Cur = (UINT8 *) AsciiStrCpy ((CHAR8 *) Cur, (CHAR8 *) Token->Filename);
+ Cur = (UINT8 *) AsciiStrCpy ((CHAR8 *) Cur, (CHAR8 *) Mode);
for (Index = 0; Index < Token->OptionCount; ++Index) {
- Cur = AsciiStrCpy (Cur, Options[Index].OptionStr);
- Cur = AsciiStrCpy (Cur, Options[Index].ValueStr);
+ Cur = (UINT8 *) AsciiStrCpy ((CHAR8 *) Cur, (CHAR8 *) Options[Index].OptionStr);
+ Cur = (UINT8 *) AsciiStrCpy ((CHAR8 *) Cur, (CHAR8 *) Options[Index].ValueStr);
}
return Mtftp4SendPacket (Instance, Nbuf);
@@ -333,7 +338,7 @@ Mtftp4SendError ( EFI_MTFTP4_PACKET *TftpError;
UINT32 Len;
- Len = (UINT32) (AsciiStrLen (ErrInfo) + sizeof (EFI_MTFTP4_ERROR_HEADER));
+ Len = (UINT32) (AsciiStrLen ((CHAR8 *) ErrInfo) + sizeof (EFI_MTFTP4_ERROR_HEADER));
Packet = NetbufAlloc (Len);
if (Packet == NULL) {
@@ -344,7 +349,7 @@ Mtftp4SendError ( TftpError->OpCode = HTONS (EFI_MTFTP4_OPCODE_ERROR);
TftpError->Error.ErrorCode = HTONS (ErrCode);
- AsciiStrCpy (TftpError->Error.ErrorMessage, ErrInfo);
+ AsciiStrCpy ((CHAR8 *) TftpError->Error.ErrorMessage, (CHAR8 *) ErrInfo);
return Mtftp4SendPacket (Instance, Packet);
}
@@ -419,6 +424,7 @@ Mtftp4SendPacket ( UDP_POINTS UdpPoint;
EFI_STATUS Status;
UINT16 OpCode;
+ UINT16 Value;
//
// Save the packet for retransmission
@@ -440,7 +446,8 @@ Mtftp4SendPacket ( // Send the requests to the listening port, other packets
// to the connected port
//
- OpCode = NTOHS (*((UINT16 *) NetbufGetByte (Packet, 0, NULL)));
+ Value = *((UINT16 *) NetbufGetByte (Packet, 0, NULL));
+ OpCode = NTOHS (Value);
if ((OpCode == EFI_MTFTP4_OPCODE_RRQ) || (OpCode == EFI_MTFTP4_OPCODE_DIR) ||
(OpCode == EFI_MTFTP4_OPCODE_WRQ)) {
@@ -485,6 +492,7 @@ Mtftp4Retransmit ( UDP_POINTS UdpPoint;
EFI_STATUS Status;
UINT16 OpCode;
+ UINT16 Value;
ASSERT (Instance->LastPacket != NULL);
@@ -495,7 +503,8 @@ Mtftp4Retransmit ( //
// Set the requests to the listening port, other packets to the connected port
//
- OpCode = NTOHS (*(UINT16 *) NetbufGetByte (Instance->LastPacket, 0, NULL));
+ Value = *(UINT16 *) NetbufGetByte (Instance->LastPacket, 0, NULL);
+ OpCode = NTOHS (Value);
if ((OpCode == EFI_MTFTP4_OPCODE_RRQ) || (OpCode == EFI_MTFTP4_OPCODE_DIR) ||
(OpCode == EFI_MTFTP4_OPCODE_WRQ)) {
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c index 5ac5dc8ec0..a3b308f266 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c @@ -139,7 +139,7 @@ Mtftp4WrqSendBlock ( // Get data from PacketNeeded
//
DataBuf = NULL;
- Status = Token->PacketNeeded (&Instance->Mtftp4, Token, &DataLen, &DataBuf);
+ Status = Token->PacketNeeded (&Instance->Mtftp4, Token, &DataLen, (VOID **) &DataBuf);
if (EFI_ERROR (Status) || (DataLen > Instance->BlkSize)) {
if (DataBuf != NULL) {
diff --git a/MdeModulePkg/Universal/Network/PxeBcDxe/Bc.c b/MdeModulePkg/Universal/Network/PxeBcDxe/Bc.c index 5f15c81e48..a520349135 100644 --- a/MdeModulePkg/Universal/Network/PxeBcDxe/Bc.c +++ b/MdeModulePkg/Universal/Network/PxeBcDxe/Bc.c @@ -291,8 +291,12 @@ IpChecksum2 ( )
{
UINT32 Sum;
+ UINT16 HeaderChecksum;
+ UINT16 MessageChecksum;
- Sum = (UINT16)~IpChecksum (Header, HeaderLen) + (UINT16)~IpChecksum (Message, MessageLen);
+ HeaderChecksum = (UINT16)~IpChecksum (Header, HeaderLen);
+ MessageChecksum = (UINT16)~IpChecksum (Message, MessageLen);
+ Sum = HeaderChecksum + MessageChecksum;
//
// in case above carried
@@ -1350,7 +1354,7 @@ BcStart ( Status = gBS->AllocatePool (
EfiBootServicesData,
BUFFER_ALLOCATE_SIZE,
- &Private->TransmitBufferPtr
+ (VOID **) &Private->TransmitBufferPtr
);
if (!EFI_ERROR (Status)) {
@@ -1364,7 +1368,7 @@ BcStart ( Status = gBS->AllocatePool (
EfiBootServicesData,
BUFFER_ALLOCATE_SIZE,
- &Private->ReceiveBufferPtr
+ (VOID **) &Private->ReceiveBufferPtr
);
if (!EFI_ERROR (Status)) {
@@ -1379,7 +1383,7 @@ BcStart ( Status = gBS->AllocatePool (
EfiBootServicesData,
256,
- &Private->TftpErrorBuffer
+ (VOID **) &Private->TftpErrorBuffer
);
if (EFI_ERROR (Status)) {
@@ -1389,7 +1393,7 @@ BcStart ( return EFI_OUT_OF_RESOURCES;
}
- Status = gBS->AllocatePool (EfiBootServicesData, 256, &Private->TftpAckBuffer);
+ Status = gBS->AllocatePool (EfiBootServicesData, 256, (VOID **) &Private->TftpAckBuffer);
if (EFI_ERROR (Status)) {
gBS->FreePool (Private->TftpErrorBuffer);
@@ -1473,7 +1477,6 @@ BcStop ( //
// Lock the instance data
//
- EFI_PXE_BASE_CODE_MODE *PxebcMode;
EFI_SIMPLE_NETWORK_PROTOCOL *SnpPtr;
EFI_SIMPLE_NETWORK_MODE *SnpModePtr;
EFI_STATUS StatCode;
@@ -1495,7 +1498,6 @@ BcStop ( EfiAcquireLock (&Private->Lock);
- PxebcMode = Private->EfiBc.Mode;
SnpPtr = Private->SimpleNetwork;
SnpModePtr = SnpPtr->Mode;
@@ -1875,7 +1877,7 @@ BcSetParameters ( if (SendGuidPtr != NULL) {
if (*SendGuidPtr) {
- if (PxeBcLibGetSmbiosSystemGuidAndSerialNumber (&TmpGuid, &SerialNumberPtr) != EFI_SUCCESS) {
+ if (PxeBcLibGetSmbiosSystemGuidAndSerialNumber (&TmpGuid, (CHAR8 **) &SerialNumberPtr) != EFI_SUCCESS) {
return EFI_INVALID_PARAMETER;
}
}
@@ -2395,7 +2397,7 @@ InitializeBCDriver ( InitArpHeader ();
OptionsStrucInit ();
- return EFI_SUCCESS;
+ return Status;
}
/* eof - bc.c */
diff --git a/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_arp.c b/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_arp.c index 3654363e8e..59ace83125 100644 --- a/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_arp.c +++ b/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_arp.c @@ -338,7 +338,7 @@ SendRequest ( Status = gBS->AllocatePool (
EfiBootServicesData,
SnpMode->MediaHeaderSize + sizeof (ARP_PACKET),
- &Private->ArpBuffer
+ (VOID **) &Private->ArpBuffer
);
if (EFI_ERROR (Status)) {
diff --git a/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_dhcp.c b/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_dhcp.c index 7dec5ec2d2..d0eb98cfb7 100644 --- a/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_dhcp.c +++ b/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_dhcp.c @@ -214,7 +214,7 @@ OptionsStrucInit ( CopyMem (DHCPOpStart.DhcpClassIdentifier.Data.UndiMajor, "yyy", sizeof ("yyy"));
CopyMem (DHCPOpStart.DhcpClassIdentifier.Data.UndiMinor, "xxx", sizeof ("xxx"));
DHCPOpStart.End[0] = OP_END;
-};
+}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
@@ -883,7 +883,7 @@ Parse ( } else if (!RxBufPtr->OpAdds.PktOptAdds[OP_DHCP_BOOTFILE_IX - 1] && RxBufPtr->u.Dhcpv4.file[0]) {
RxBufPtr->OpAdds.PktOptAdds[OP_DHCP_BOOTFILE_IX - 1] = (DHCPV4_OP_STRUCT *) (RxBufPtr->u.Dhcpv4.file - sizeof (DHCPV4_OP_HEADER));
- RxBufPtr->OpAdds.PktOptAdds[OP_DHCP_BOOTFILE_IX - 1]->Header.Length = (UINT8) AsciiStrLen (RxBufPtr->u.Dhcpv4.file);
+ RxBufPtr->OpAdds.PktOptAdds[OP_DHCP_BOOTFILE_IX - 1]->Header.Length = (UINT8) AsciiStrLen ((CHAR8 *) RxBufPtr->u.Dhcpv4.file);
}
LocalPtr.OpPtr = RxBufPtr->OpAdds.PktOptAdds[OP_DHCP_CLASS_IDENTIFIER_IX - 1];
@@ -3169,13 +3169,11 @@ BcSetPackets ( {
EFI_PXE_BASE_CODE_MODE *PxebcMode;
EFI_STATUS Status;
- EFI_STATUS StatCode;
PXE_BASECODE_DEVICE *Private;
//
// Lock the instance data and make sure started
//
- StatCode = EFI_SUCCESS;
if (This == NULL) {
DEBUG ((DEBUG_ERROR, "BC *This pointer == NULL"));
diff --git a/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_mtftp.c b/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_mtftp.c index 43e1bbb429..6a42646ab3 100644 --- a/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_mtftp.c +++ b/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_bc_mtftp.c @@ -555,7 +555,7 @@ TftpRwReq ( //
u = Buffer;
u->ReqStr.OpCode = HTONS (Req);
- TotalLen = sizeof (Mode) + sizeof (u->ReqStr.OpCode) + (Len = 1 + AsciiStrLen (FilenamePtr));
+ TotalLen = sizeof (Mode) + sizeof (u->ReqStr.OpCode) + (Len = 1 + AsciiStrLen ((CHAR8 *) FilenamePtr));
CopyMem (u->ReqStr.FileName, FilenamePtr, Len);
Ptr = (UINT8 *) (u->ReqStr.FileName + Len);
@@ -567,7 +567,7 @@ TftpRwReq ( CopyMem (Ptr, BlockSizeOp, sizeof (BlockSizeOp));
UtoA10 (*PacketSizePtr, Ptr + sizeof (BlockSizeOp));
- TotalLen += (Len = 1 + AsciiStrLen (Ptr + sizeof (BlockSizeOp)) + sizeof (BlockSizeOp));
+ TotalLen += (Len = 1 + AsciiStrLen ((CHAR8 *) (Ptr + sizeof (BlockSizeOp))) + sizeof (BlockSizeOp));
Ptr += Len;
}
@@ -1387,7 +1387,7 @@ TftpInfo ( (UINT16) ReplyLen,
BufferSizePtr,
Offset,
- (INT8 *) &u,
+ (UINT8 *) &u,
ServerIpPtr,
&ServerReplyPort,
&Private->EfiBc.Mode->StationIp,
@@ -1899,7 +1899,7 @@ PxeBcMtftp ( Status = gBS->AllocatePool (
EfiBootServicesData,
BUFFER_ALLOCATE_SIZE,
- &BufferPtrLocal
+ (VOID **) &BufferPtrLocal
);
if (EFI_ERROR (Status) || BufferPtrLocal == NULL) {
diff --git a/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_loadfile.c b/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_loadfile.c index 7c5d0bc2fb..e430757ce4 100644 --- a/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_loadfile.c +++ b/MdeModulePkg/Universal/Network/PxeBcDxe/Pxe_loadfile.c @@ -374,7 +374,6 @@ DoPrompt ( if (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key) == EFI_NOT_READY) {
UINT8 Buffer[512];
UINTN BufferSize;
- EFI_STATUS Status;
BufferSize = sizeof Buffer;
@@ -1036,7 +1035,6 @@ DownloadFile ( if (Private->EfiBc.Mode->BisSupported && Private->EfiBc.Mode->BisDetected && Private->EfiBc.Mode->PxeBisReplyReceived) {
UINT64 CredentialLen;
- UINTN BlockSize;
UINT8 CredentialFilename[256];
UINT8 *op;
VOID *CredentialBuffer;
@@ -1327,6 +1325,12 @@ LoadFile ( BOOLEAN NewMakeCallback;
EFI_STATUS Status;
EFI_STATUS TempStatus;
+
+ //
+ // The following line is only used for passing ICC build.
+ //
+ DEBUG ((EFI_D_INFO, "FilePath = %x\n", FilePath));
+
//
//
//
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c index 536a01a1d5..2278e84a82 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c @@ -358,7 +358,7 @@ Tcp4ConfigurePcb ( //
// Add Ip for send pkt to the peer
//
- CopyMem (&IpCfgData, &mIpIoDefaultIpConfigData, sizeof (EFI_IP4_CONFIG_DATA));
+ CopyMem (&IpCfgData, &mIpIoDefaultIpConfigData, sizeof (IpCfgData));
IpCfgData.DefaultProtocol = EFI_IP_PROTO_TCP;
IpCfgData.UseDefaultAddress = CfgData->AccessPoint.UseDefaultAddress;
IpCfgData.StationAddress = CfgData->AccessPoint.StationAddress;
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c index d7f9fe73f5..3ae8a2091c 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c @@ -305,7 +305,7 @@ Tcp4DriverBindingStart ( //
NetZeroMem (&OpenData, sizeof (IP_IO_OPEN_DATA));
- CopyMem (&OpenData.IpConfigData, &mIpIoDefaultIpConfigData, sizeof (EFI_IP4_CONFIG_DATA));
+ CopyMem (&OpenData.IpConfigData, &mIpIoDefaultIpConfigData, sizeof (OpenData.IpConfigData));
OpenData.IpConfigData.DefaultProtocol = EFI_IP_PROTO_TCP;
OpenData.PktRcvdNotify = Tcp4RxCallback;
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.c index 4d2e80fcad..24f97eb93b 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.c @@ -145,6 +145,7 @@ Tcp4Configure ( SOCKET *Sock;
EFI_STATUS Status;
IP4_ADDR Ip;
+ IP4_ADDR SubnetMask;
if (NULL == This) {
return EFI_INVALID_PARAMETER;
@@ -168,7 +169,8 @@ Tcp4Configure ( if (!TcpConfigData->AccessPoint.UseDefaultAddress) {
NetCopyMem (&Ip, &TcpConfigData->AccessPoint.StationAddress, sizeof (IP4_ADDR));
- if (!Ip4IsUnicast (NTOHL (Ip), 0) || !IP4_IS_VALID_NETMASK (NTOHL (Ip))) {
+ NetCopyMem (&SubnetMask, &TcpConfigData->AccessPoint.SubnetMask, sizeof (IP4_ADDR));
+ if (!Ip4IsUnicast (NTOHL (Ip), 0) || !IP4_IS_VALID_NETMASK (NTOHL (SubnetMask))) {
return EFI_INVALID_PARAMETER;
}
}
diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c index ada73d79db..624c54a4d5 100644 --- a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c +++ b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c @@ -517,7 +517,7 @@ Returns: //
// Initialize the UDP random port.
//
- mUdp4RandomPort = ((UINT16) NetRandomInitSeed ()) % UDP4_PORT_KNOWN + UDP4_PORT_KNOWN;
+ mUdp4RandomPort = (UINT16) (((UINT16) NetRandomInitSeed ()) % UDP4_PORT_KNOWN + UDP4_PORT_KNOWN);
}
return Status;
diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c index e5576820a6..fac6d33f3e 100644 --- a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c +++ b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c @@ -172,7 +172,7 @@ Udp4CreateService ( //
// Set the OpenData used to open the IpIo.
//
- CopyMem (&OpenData.IpConfigData, &mIpIoDefaultIpConfigData, sizeof (EFI_IP4_CONFIG_DATA));
+ CopyMem (&OpenData.IpConfigData, &mIpIoDefaultIpConfigData, sizeof (OpenData.IpConfigData));
OpenData.IpConfigData.AcceptBroadcast = TRUE;
OpenData.RcvdContext = (VOID *) Udp4Service;
OpenData.SndContext = NULL;
@@ -359,7 +359,7 @@ Udp4InitInstance ( // Save the pointer to the UDP4_SERVICE_DATA, and initialize other members.
//
Instance->Udp4Service = Udp4Service;
- CopyMem (&Instance->Udp4Proto, &mUdp4Protocol, sizeof (EFI_UDP4_PROTOCOL));
+ CopyMem (&Instance->Udp4Proto, &mUdp4Protocol, sizeof (Instance->Udp4Proto));
Instance->IcmpError = EFI_SUCCESS;
Instance->Configured = FALSE;
Instance->IsNoMapping = FALSE;
@@ -612,7 +612,7 @@ Udp4BuildIp4ConfigData ( IN EFI_IP4_CONFIG_DATA *Ip4ConfigData
)
{
- CopyMem (Ip4ConfigData, &mIpIoDefaultIpConfigData, sizeof (EFI_IP4_CONFIG_DATA));
+ CopyMem (Ip4ConfigData, &mIpIoDefaultIpConfigData, sizeof (*Ip4ConfigData));
Ip4ConfigData->DefaultProtocol = EFI_IP_PROTO_UDP;
Ip4ConfigData->AcceptBroadcast = Udp4ConfigData->AcceptBroadcast;
@@ -817,7 +817,7 @@ Udp4Checksum ( Checksum = NetAddChecksum (Checksum, HTONS ((UINT16) Packet->TotalSize));
- return ~Checksum;
+ return (UINT16) ~Checksum;
}
@@ -964,7 +964,7 @@ Udp4LeaveGroup ( if ((McastIp != NULL) && (!EFI_IP4_EQUAL (*McastIp, (UINTN) Item->Key))) {
//
- // McastIp is not NULL and the multicast address contained in the Item
+ // McastIp is not NULL and the multicast address contained in the Item
// is not the same as McastIp.
//
return EFI_SUCCESS;
@@ -1284,7 +1284,7 @@ Udp4WrapRxData ( NetListInit (&Wrap->Link);
- CopyMem (&Wrap->RxData, RxData, sizeof (EFI_UDP4_RECEIVE_DATA));
+ CopyMem (&Wrap->RxData, RxData, sizeof (Wrap->RxData));
//
// Create the Recycle event.
@@ -1349,7 +1349,7 @@ Udp4EnqueueDgram ( //
// Wrap the RxData and put this Wrap into the instances RcvdDgramQue.
//
- CopyMem (&Wrap, Udp4WrapRxData (Instance, Packet, RxData), sizeof (UDP4_RXDATA_WRAP));
+ CopyMem (&Wrap, Udp4WrapRxData (Instance, Packet, RxData), sizeof (Wrap));
if (Wrap == NULL) {
continue;
}
@@ -1636,7 +1636,7 @@ Udp4SendPortUnreach ( //
// Calculate the checksum.
//
- IcmpErrHdr->Head.Checksum = ~(NetbufChecksum (Packet));
+ IcmpErrHdr->Head.Checksum = (UINT16) ~(NetbufChecksum (Packet));
//
// Fill the override data.
diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c index b3daacba23..adfd011b7f 100644 --- a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c +++ b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c @@ -86,7 +86,7 @@ Udp4GetModeData ( //
// Set the Udp4ConfigData.
//
- CopyMem (Udp4ConfigData, &Instance->ConfigData, sizeof (EFI_UDP4_CONFIG_DATA));
+ CopyMem (Udp4ConfigData, &Instance->ConfigData, sizeof (*Udp4ConfigData));
}
Ip = Instance->IpInfo->Ip;
@@ -239,7 +239,7 @@ Udp4Configure ( //
// Save the configuration data.
//
- CopyMem (&Instance->ConfigData, UdpConfigData, sizeof (EFI_UDP4_CONFIG_DATA));
+ CopyMem (&Instance->ConfigData, UdpConfigData, sizeof (Instance->ConfigData));
Instance->ConfigData.StationAddress = Ip4ConfigData.StationAddress;
Instance->ConfigData.SubnetMask = Ip4ConfigData.SubnetMask;
@@ -351,7 +351,7 @@ Udp4Groups ( if (JoinFlag) {
NetCopyMem (&McastIp, MulticastAddress, sizeof (IP4_ADDR));
- if (IP4_IS_MULTICAST (NTOHL (McastIp))) {
+ if (!IP4_IS_MULTICAST (NTOHL (McastIp))) {
return EFI_INVALID_PARAMETER;
}
}
|