X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FUefiPxeBcDxe%2FPxeBcDriver.c;h=76c140d8e3ff39e4b1d9ecdc6601fc11cc5e5028;hb=f1222593f2a8944ab8f61f3864b6ae80633faecf;hp=03bde34116d68b245c0d02badf99e0b862d6f779;hpb=e5eed7d3641d71d7ea539e5379ea9c6a5cd97004;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c index 03bde34116..76c140d8e3 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c @@ -1,7 +1,7 @@ /** @file The driver binding for UEFI PXEBC protocol. -Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -254,15 +254,15 @@ PxeBcDriverBindingStart ( if (EFI_ERROR (Status)) { goto ON_ERROR; } - - // + + // // Get max packet size from Ip4 to calculate block size for Tftp later. - // - Status = Private->Ip4->GetModeData (Private->Ip4, &Ip4ModeData, NULL, NULL); - if (EFI_ERROR (Status)) { - goto ON_ERROR; - } - + // + Status = Private->Ip4->GetModeData (Private->Ip4, &Ip4ModeData, NULL, NULL); + if (EFI_ERROR (Status)) { + goto ON_ERROR; + } + Private->Ip4MaxPacketSize = Ip4ModeData.MaxPacketSize; Status = NetLibCreateServiceChild ( @@ -341,7 +341,7 @@ PxeBcDriverBindingStart ( goto ON_ERROR; } ZeroMem (&Private->Udp4CfgData, sizeof (EFI_UDP4_CONFIG_DATA)); - Private->Udp4CfgData.AcceptBroadcast = TRUE; + Private->Udp4CfgData.AcceptBroadcast = FALSE; Private->Udp4CfgData.AcceptPromiscuous = FALSE; Private->Udp4CfgData.AcceptAnyPort = TRUE; Private->Udp4CfgData.AllowDuplicatePort = TRUE; @@ -375,6 +375,17 @@ PxeBcDriverBindingStart ( if (EFI_ERROR (Status)) { goto ON_ERROR; } + // + // Locate Ip4->Ip4Config2 and store it for set IPv4 Policy. + // + Status = gBS->HandleProtocol ( + ControllerHandle, + &gEfiIp4Config2ProtocolGuid, + (VOID **) &Private->Ip4Config2 + ); + if (EFI_ERROR (Status)) { + goto ON_ERROR; + } return EFI_SUCCESS; @@ -526,7 +537,7 @@ PxeBcDriverBindingStop ( NicHandle = NetLibGetNicHandle (ControllerHandle, &gEfiMtftp4ProtocolGuid); if (NicHandle == NULL) { - return EFI_DEVICE_ERROR; + return EFI_SUCCESS; } } }