public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1] NetworkPkg/UefiPxeBcDxe: Fix PXE_BOOT_SERVERS usage in boot info parse flow
@ 2020-08-19 16:53 Maciej Rabeda
  2020-08-19 18:13 ` [edk2-devel] " Laszlo Ersek
  2020-08-20  3:35 ` Siyuan, Fu
  0 siblings, 2 replies; 12+ messages in thread
From: Maciej Rabeda @ 2020-08-19 16:53 UTC (permalink / raw)
  To: devel; +Cc: Jiaxin Wu, Siyuan Fu

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2876

According to PXE 2.1 spec, DHCP option 43, tag 6 (PXE_DISCOVERY_CONTROL),
bit 3 specifies whether PXE client should use/accept TFTP servers defined
within PXE_BOOT_SERVERS list (tag 8). This bit was not being taken into
account when choosing boot server IP in PxeBcDhcp4BootInfo().

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
---
 NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c b/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c
index d062a526077b..ed9bca0f7de3 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c
@@ -499,12 +499,16 @@ PxeBcDhcp4BootInfo (
 
   //
   // Parse the boot server address.
-  // If prompt/discover is disabled, get the first boot server from the boot servers list.
-  // Otherwise, parse the boot server Ipv4 address from next server address field in DHCP header.
+  // If prompt/discover is disabled, server list should be used and is present (DHCP option 43),
+  // get the first boot server from the boot servers list.
+  // Otherwise, parse the boot server IPv4 address from next server address field in DHCP header.
   // If all these fields are not available, use option 54 instead.
   //
   VendorOpt = &Cache4->VendorOpt;
-  if (IS_DISABLE_PROMPT_MENU (VendorOpt->DiscoverCtrl) && IS_VALID_BOOT_SERVERS (VendorOpt->BitMap)) {
+  if (IS_DISABLE_PROMPT_MENU (VendorOpt->DiscoverCtrl) &&
+      IS_VALID_BOOT_SERVERS (VendorOpt->BitMap) &&
+      IS_ENABLE_USE_SERVER_LIST (VendorOpt->DiscoverCtrl))
+  {
     Entry = VendorOpt->BootSvr;
     if (VendorOpt->BootSvrLen >= sizeof (PXEBC_BOOT_SVR_ENTRY) && Entry->IpCnt > 0) {
       CopyMem (
-- 
2.24.0.windows.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-08-23 16:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-19 16:53 [PATCH v1] NetworkPkg/UefiPxeBcDxe: Fix PXE_BOOT_SERVERS usage in boot info parse flow Maciej Rabeda
2020-08-19 18:13 ` [edk2-devel] " Laszlo Ersek
2020-08-19 18:46   ` Michael Brown
2020-08-21 11:19     ` Laszlo Ersek
2020-08-23 16:24       ` Michael Brown
2020-08-19 19:20   ` Laszlo Ersek
2020-08-20 10:44     ` Maciej Rabeda
2020-08-20 13:41       ` Michael Brown
2020-08-21  9:11         ` Laszlo Ersek
2020-08-21 10:57           ` 回复: " Ding, Seven
2020-08-21 11:15           ` Maciej Rabeda
2020-08-20  3:35 ` Siyuan, Fu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox