Merger network tackers 9307, 9338, 9339, 9397
[people/mcb30/edk2.git] / edk2 / MdeModulePkg / Universal / Network / Ip4ConfigDxe / Ip4Config.c
index 31d9e8b..bec1a4f 100644 (file)
@@ -622,14 +622,15 @@ Ip4ConfigOnDhcp4Complete (
       NetFreePool (Instance->NicConfig);\r
     }\r
 \r
-    Instance->NicConfig = NetAllocatePool (sizeof (NIC_IP4_CONFIG_INFO) +\r
-                                           sizeof (EFI_IP4_ROUTE_TABLE));\r
+    Instance->NicConfig = NetAllocatePool (sizeof (NIC_IP4_CONFIG_INFO) + 2* sizeof (EFI_IP4_ROUTE_TABLE));\r
 \r
     if (Instance->NicConfig == NULL) {\r
       Instance->Result = EFI_OUT_OF_RESOURCES;\r
       goto ON_EXIT;\r
     }\r
 \r
+    Instance->NicConfig->Ip4Info.RouteTable = (EFI_IP4_ROUTE_TABLE *) (Instance->NicConfig + 1);\r
+\r
     CopyMem (&Instance->NicConfig->NicAddr, &Instance->NicAddr, sizeof (Instance->NicConfig->NicAddr));\r
     Instance->NicConfig->Source  = IP4_CONFIG_SOURCE_DHCP;\r
     Instance->NicConfig->Perment = Perment;\r
@@ -645,7 +646,7 @@ Ip4ConfigOnDhcp4Complete (
 \r
     NetCopyMem (&Ip1, &Dhcp4Mode.ClientAddress, sizeof (IP4_ADDR));\r
     NetCopyMem (&Ip2, &Dhcp4Mode.SubnetMask, sizeof (IP4_ADDR));\r
-    \r
+\r
     Subnet = Ip1 & Ip2;\r
 \r
     NetCopyMem (&Ip4Config->RouteTable[0].SubnetAddress, &Subnet, sizeof (EFI_IPv4_ADDRESS));\r