]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
1. Add EFI_COMPONENT_NAME2_PROTOCOL.GetControllerName() support.
[mirror_edk2.git] / NetworkPkg / UefiPxeBcDxe / PxeBcDriver.c
index 179009f91c600802fb47c0f94ee5027e79ccb0a9..b29df68bbdb864158d8a46b4971af3bb91f80fde 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Driver Binding functions implementationfor for UefiPxeBc Driver.\r
 \r
-  Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2007 - 2012, 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
@@ -779,6 +779,7 @@ PxeBcCreateIp6Children (
   EFI_IP6_MODE_DATA               Ip6ModeData;\r
   PXEBC_PRIVATE_PROTOCOL          *Id;\r
   EFI_SIMPLE_NETWORK_PROTOCOL     *Snp;\r
+  UINTN                           Index;\r
 \r
   if (Private->Ip6Nic != NULL) {\r
     //\r
@@ -821,6 +822,16 @@ PxeBcCreateIp6Children (
     goto ON_ERROR;\r
   }\r
 \r
+  //\r
+  // Generate a random IAID for the Dhcp6 assigned address.\r
+  //\r
+  Private->IaId = NET_RANDOM (NetRandomInitSeed ());\r
+  if (Private->Snp != NULL) {\r
+    for (Index = 0; Index < Private->Snp->Mode->HwAddressSize; Index++) {\r
+      Private->IaId |= (Private->Snp->Mode->CurrentAddress.Addr[Index] << ((Index << 3) & 31));\r
+    }  \r
+  }\r
+\r
   //\r
   // Create Mtftp6 child and open Mtftp6 protocol for PxeBc->Mtftp.\r
   //\r
@@ -1387,7 +1398,7 @@ PxeBcDriverBindingStop (
     if (NicHandle == NULL) {\r
       NicHandle = PxeBcGetNicByIp6Children (ControllerHandle);\r
       if (NicHandle == NULL) {\r
-        return EFI_DEVICE_ERROR;\r
+        return EFI_SUCCESS;\r
       } else {\r
         IsIpv6 = TRUE;\r
       }\r