]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
1. Fix a bug in PXE driver that the PXE boot do not restart if a new boot option...
[mirror_edk2.git] / NetworkPkg / UefiPxeBcDxe / PxeBcDriver.c
index 179009f91c600802fb47c0f94ee5027e79ccb0a9..080b751cb19637541e81ef9bdec8db16c3302aaf 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