]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
BaseTools: GenFds - move RegEx compile
[mirror_edk2.git] / NetworkPkg / UefiPxeBcDxe / PxeBcDriver.c
index c2987b8734a8986cbba9e0e776ca08842fa919ab..8dd787be1a00aed74701804713b3d7a6ff77ed75 100644 (file)
@@ -2,7 +2,7 @@
   Driver Binding functions implementationfor for UefiPxeBc Driver.\r
 \r
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -254,6 +254,7 @@ PxeBcDestroyIp4Children (
            &Private->PxeBc,\r
            NULL\r
            );\r
+    FreePool (Private->Ip4Nic->DevicePath);\r
 \r
     if (Private->Snp != NULL) { \r
       //\r
@@ -414,6 +415,8 @@ PxeBcDestroyIp6Children (
            &Private->PxeBc,\r
            NULL\r
            );\r
+    FreePool (Private->Ip6Nic->DevicePath);\r
+    \r
     if (Private->Snp != NULL) {\r
       //\r
       // Close SNP from the child virtual handle\r
@@ -742,6 +745,18 @@ PxeBcCreateIp4Children (
   Private->Ip4Nic->Private   = Private;\r
   Private->Ip4Nic->Signature = PXEBC_VIRTUAL_NIC_SIGNATURE;\r
 \r
+   //\r
+  // Locate Ip4->Ip4Config2 and store it for set IPv4 Policy.\r
+  //\r
+  Status = gBS->HandleProtocol (\r
+                  ControllerHandle,\r
+                  &gEfiIp4Config2ProtocolGuid,\r
+                  (VOID **) &Private->Ip4Config2\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    goto ON_ERROR;\r
+  }\r
+\r
   //\r
   // Create a device path node for Ipv4 virtual nic, and append it.\r
   //\r
@@ -1049,6 +1064,30 @@ PxeBcCreateIp6Children (
 \r
   Private->Ip6MaxPacketSize = Ip6ModeData.MaxPacketSize;\r
 \r
+  if (Ip6ModeData.AddressList != NULL) {\r
+    FreePool (Ip6ModeData.AddressList);\r
+  }\r
+\r
+  if (Ip6ModeData.GroupTable != NULL) {\r
+    FreePool (Ip6ModeData.GroupTable);\r
+  }\r
+\r
+  if (Ip6ModeData.RouteTable != NULL) {\r
+    FreePool (Ip6ModeData.RouteTable);\r
+  }\r
+\r
+  if (Ip6ModeData.NeighborCache != NULL) {\r
+    FreePool (Ip6ModeData.NeighborCache);\r
+  }\r
+\r
+  if (Ip6ModeData.PrefixTable != NULL) {\r
+    FreePool (Ip6ModeData.PrefixTable);\r
+  }\r
+\r
+  if (Ip6ModeData.IcmpTypeList != NULL) {\r
+    FreePool (Ip6ModeData.IcmpTypeList);\r
+  }\r
+\r
   //\r
   // Locate Ip6->Ip6Config and store it for set IPv6 address.\r
   //\r