summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network/Ip4ConfigDxe
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-07-30 02:37:10 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-07-30 02:37:10 +0000
commit772db4bb33ae66fa20e39f786b5f80d107d450a5 (patch)
tree206a2d4756e0f7e245e08ca75f3ba10df2e1cf7a /MdeModulePkg/Universal/Network/Ip4ConfigDxe
parenteca7eaf49be5f23e3c79270621df7097ef585349 (diff)
downloadedk2-platforms-772db4bb33ae66fa20e39f786b5f80d107d450a5.tar.xz
Import ArpDxe, Dhcp4Dxe, Ip4Dxe, Mtftp4Dxe, PxeBcDxe and PxeDhcp4Dxe.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3492 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/Ip4ConfigDxe')
-rw-r--r--MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c24
-rw-r--r--MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c1
2 files changed, 15 insertions, 10 deletions
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c
index 326fb4dc33..a1bae0f29d 100644
--- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c
+++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c
@@ -590,6 +590,8 @@ Ip4ConfigOnDhcp4Complete (
EFI_STATUS Status;
BOOLEAN Perment;
IP4_ADDR Subnet;
+ IP4_ADDR Ip1;
+ IP4_ADDR Ip2;
Instance = (IP4_CONFIG_INSTANCE *) Context;
ASSERT (Instance->Dhcp4 != NULL);
@@ -641,20 +643,24 @@ Ip4ConfigOnDhcp4Complete (
//
Ip4Config->RouteTableSize = 1;
- Subnet = EFI_NTOHL (Dhcp4Mode.ClientAddress) & EFI_NTOHL (Dhcp4Mode.SubnetMask);
+ NetCopyMem (&Ip1, &Dhcp4Mode.ClientAddress, sizeof (IP4_ADDR));
+ NetCopyMem (&Ip2, &Dhcp4Mode.SubnetMask, sizeof (IP4_ADDR));
+
+ Subnet = Ip1 & Ip2;
- EFI_IP4 (Ip4Config->RouteTable[0].SubnetAddress) = HTONL (Subnet);
- Ip4Config->RouteTable[0].SubnetMask = Dhcp4Mode.SubnetMask;
- EFI_IP4 (Ip4Config->RouteTable[0].GatewayAddress) = 0;
+ NetCopyMem (&Ip4Config->RouteTable[0].SubnetAddress, &Subnet, sizeof (EFI_IPv4_ADDRESS));
+ NetCopyMem (&Ip4Config->RouteTable[0].SubnetMask, &Dhcp4Mode.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
+ NetZeroMem (&Ip4Config->RouteTable[0].GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
//
// Create a route if there is a default router.
//
- if (EFI_IP4 (Dhcp4Mode.RouterAddress) != 0) {
- Ip4Config->RouteTableSize = 2;
- EFI_IP4 (Ip4Config->RouteTable[1].SubnetAddress) = 0;
- EFI_IP4 (Ip4Config->RouteTable[1].SubnetMask) = 0;
- Ip4Config->RouteTable[1].GatewayAddress = Dhcp4Mode.RouterAddress;
+ if (!EFI_IP4_EQUAL (Dhcp4Mode.RouterAddress, mZeroIp4Addr)) {
+ Ip4Config->RouteTableSize = 2;
+
+ NetZeroMem (&Ip4Config->RouteTable[1].SubnetAddress, sizeof (EFI_IPv4_ADDRESS));
+ NetZeroMem (&Ip4Config->RouteTable[1].SubnetMask, sizeof (EFI_IPv4_ADDRESS));
+ NetCopyMem (&Ip4Config->RouteTable[1].GatewayAddress, &Dhcp4Mode.RouterAddress, sizeof (EFI_IPv4_ADDRESS));
}
Instance->Result = EFI_SUCCESS;
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
index 265135a117..3d857b047e 100644
--- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
+++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
@@ -60,7 +60,6 @@ EfiIp4ConfigUnload (
return NetLibDefaultUnload (ImageHandle);
}
-//@MT: EFI_DRIVER_ENTRY_POINT (Ip4ConfigDriverEntryPoint)
EFI_STATUS
Ip4ConfigDriverEntryPoint (