summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-08-30 06:58:37 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-08-30 06:58:37 +0000
commitb61439a709bb961f2f9dff1d1a4112e30a063f51 (patch)
tree67a555871171cf54ad9a662957f8cd49c7035b02 /MdeModulePkg/Library
parentdc59293a36f538eb6c32517c409d5992d8c2d763 (diff)
downloadedk2-platforms-b61439a709bb961f2f9dff1d1a4112e30a063f51.tar.xz
1. Fixed one bug in Undi driver.
2. Add default branch to meet CYGWINGCC build in Tcp4Dispatcher.c. 3. Sync the latest network stack library. 4. Fixed one bug in Mtftp4Support.c, for AsciiStrCpy() return the pointer to head of string, not the tail of string. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3741 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library')
-rw-r--r--MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c13
-rw-r--r--MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf1
-rw-r--r--MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.c27
-rw-r--r--MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf1
4 files changed, 27 insertions, 15 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)) {
diff --git a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
index c797952f65..c844a84100 100644
--- a/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
+++ b/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
@@ -46,6 +46,7 @@
DebugLib
UefiBootServicesTableLib
MemoryAllocationLib
+ BaseMemoryLib
[Protocols]
gEfiIp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
diff --git a/MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.c b/MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.c
index b66348c284..d56456afb2 100644
--- a/MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.c
+++ b/MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.c
@@ -30,6 +30,7 @@ Abstract:
#include <Library/DebugLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/MemoryAllocationLib.h>
+#include <library/BaseMemoryLib.h>
STATIC
VOID
@@ -77,6 +78,7 @@ UdpIoWrapTx (
EFI_UDP4_TRANSMIT_DATA *UdpTxData;
EFI_STATUS Status;
UINT32 Count;
+ IP4_ADDR Ip;
Token = NetAllocatePool (sizeof (UDP_TX_TOKEN) +
sizeof (EFI_UDP4_FRAGMENT_DATA) * (Packet->BlockOpNum - 1));
@@ -116,15 +118,21 @@ UdpIoWrapTx (
UdpTxData->GatewayAddress = NULL;
if (EndPoint != NULL) {
- EFI_IP4 (Token->UdpSession.SourceAddress) = HTONL (EndPoint->LocalAddr);
- EFI_IP4 (Token->UdpSession.DestinationAddress) = HTONL (EndPoint->RemoteAddr);
- Token->UdpSession.SourcePort = EndPoint->LocalPort;
- Token->UdpSession.DestinationPort = EndPoint->RemotePort;
- UdpTxData->UdpSessionData = &Token->UdpSession;
+ Ip = HTONL (EndPoint->LocalAddr);
+ NetCopyMem (&Token->UdpSession.SourceAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
+
+ Ip = HTONL (EndPoint->RemoteAddr);
+ NetCopyMem (&Token->UdpSession.DestinationAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
+
+ Token->UdpSession.SourcePort = EndPoint->LocalPort;
+ Token->UdpSession.DestinationPort = EndPoint->RemotePort;
+ UdpTxData->UdpSessionData = &Token->UdpSession;
}
if (Gateway != 0) {
- EFI_IP4 (Token->Gateway) = HTONL (Gateway);
+ Ip = HTONL (Gateway);
+ NetCopyMem (&Token->Gateway, &Ip, sizeof (EFI_IPv4_ADDRESS));
+
UdpTxData->GatewayAddress = &Token->Gateway;
}
@@ -670,11 +678,14 @@ UdpIoOnDgramRcvd (
}
UdpSession = &UdpRxData->UdpSession;
- Points.LocalAddr = EFI_NTOHL (UdpSession->DestinationAddress);
Points.LocalPort = UdpSession->DestinationPort;
- Points.RemoteAddr = EFI_NTOHL (UdpSession->SourceAddress);
Points.RemotePort = UdpSession->SourcePort;
+ NetCopyMem (&Points.LocalAddr, &UdpSession->DestinationAddress, sizeof (IP4_ADDR));
+ NetCopyMem (&Points.RemoteAddr, &UdpSession->SourceAddress, sizeof (IP4_ADDR));
+ Points.LocalAddr = NTOHL (Points.LocalAddr);
+ Points.RemoteAddr = NTOHL (Points.RemoteAddr);
+
Token->CallBack (Netbuf, &Points, EFI_SUCCESS, Token->Context);
ON_EXIT:
diff --git a/MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf b/MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
index 32ccb96c32..7a20e80d3c 100644
--- a/MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
+++ b/MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
@@ -46,6 +46,7 @@
DebugLib
UefiBootServicesTableLib
MemoryAllocationLib
+ BaseMemoryLib
[Protocols]
gEfiUdp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED