diff options
Diffstat (limited to 'NetworkPkg/UefiPxeBcDxe')
-rw-r--r-- | NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c | 2 | ||||
-rw-r--r-- | NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c | 2 | ||||
-rw-r--r-- | NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c | 13 | ||||
-rw-r--r-- | NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c | 9 | ||||
-rw-r--r-- | NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h | 1 |
5 files changed, 24 insertions, 3 deletions
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c index ecafc86a03..23682b2451 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c @@ -532,7 +532,7 @@ PxeBcParseDhcp4Packet ( (Offer->Dhcp4.Header.BootFileName[0] != 0)) {
//
// If the bootfile is not present and bootfilename is present in DHCPv4 packet, just parse it.
- // Do not count dhcp option header here, or else will destory the serverhostname.
+ // Do not count dhcp option header here, or else will destroy the serverhostname.
//
Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] = (EFI_DHCP4_PACKET_OPTION *)
(&Offer->Dhcp4.Header.BootFileName[0] -
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c index 6ab2afa088..1eb64a6a0f 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c @@ -1748,7 +1748,7 @@ PxeBcDhcp6Sarr ( Config.IaInfoEvent = NULL;
Config.RapidCommit = FALSE;
Config.ReconfigureAccept = FALSE;
- Config.IaDescriptor.IaId = 1;
+ Config.IaDescriptor.IaId = Private->IaId;
Config.IaDescriptor.Type = EFI_DHCP6_IA_TYPE_NA;
Config.SolicitRetransmission = Retransmit;
Retransmit->Irt = 4;
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c index 179009f91c..080b751cb1 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c @@ -1,7 +1,7 @@ /** @file
Driver Binding functions implementationfor for UefiPxeBc Driver.
- Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -779,6 +779,7 @@ PxeBcCreateIp6Children ( EFI_IP6_MODE_DATA Ip6ModeData;
PXEBC_PRIVATE_PROTOCOL *Id;
EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
+ UINTN Index;
if (Private->Ip6Nic != NULL) {
//
@@ -822,6 +823,16 @@ PxeBcCreateIp6Children ( }
//
+ // Generate a random IAID for the Dhcp6 assigned address.
+ //
+ Private->IaId = NET_RANDOM (NetRandomInitSeed ());
+ if (Private->Snp != NULL) {
+ for (Index = 0; Index < Private->Snp->Mode->HwAddressSize; Index++) {
+ Private->IaId |= (Private->Snp->Mode->CurrentAddress.Addr[Index] << ((Index << 3) & 31));
+ }
+ }
+
+ //
// Create Mtftp6 child and open Mtftp6 protocol for PxeBc->Mtftp.
//
Status = NetLibCreateServiceChild (
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c index 5f693729d6..183dc0ced7 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c @@ -2348,6 +2348,15 @@ EfiPxeLoadFile ( // Start Pxe Base Code to initialize PXE boot.
//
Status = PxeBc->Start (PxeBc, UsingIpv6);
+ if (Status == EFI_ALREADY_STARTED && UsingIpv6 != PxeBc->Mode->UsingIpv6) {
+ //
+ // PxeBc protocol has already been started but not on the required IP version, restart it.
+ //
+ Status = PxeBc->Stop (PxeBc);
+ if (!EFI_ERROR (Status)) {
+ Status = PxeBc->Start (PxeBc, UsingIpv6);
+ }
+ }
if (Status == EFI_SUCCESS || Status == EFI_ALREADY_STARTED) {
Status = PxeBcLoadBootFile (Private, BufferSize, Buffer);
}
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h index bea4931efb..1d4381a1f5 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h @@ -165,6 +165,7 @@ struct _PXEBC_PRIVATE_DATA { EFI_IP_ADDRESS GatewayIp;
EFI_IP_ADDRESS ServerIp;
UINT16 CurSrcPort;
+ UINT32 IaId;
UINT32 Ip4MaxPacketSize;
UINT32 Ip6MaxPacketSize;
|