From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.92699.1597856031379793917 for ; Wed, 19 Aug 2020 09:53:51 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: linux.intel.com, ip: 192.55.52.136, mailfrom: maciej.rabeda@linux.intel.com) IronPort-SDR: Tf3/bxh3KcE2fUWwziSPS8Xx/Mcd8tHILT/jKn/h0cOebNbd4fMAA6x9FUOlnnfV1PjFULKksx ZYYKx8KZGTMw== X-IronPort-AV: E=McAfee;i="6000,8403,9718"; a="134676830" X-IronPort-AV: E=Sophos;i="5.76,332,1592895600"; d="scan'208";a="134676830" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2020 09:53:50 -0700 IronPort-SDR: xpz2Y4UI1PWJbjcS1i5gyCdQ1v5kfLgRLX+vLJvVDr174Zuj807WsGwGkQLMS4pOyN1cjuAdhd qr+YIXovUOWQ== X-IronPort-AV: E=Sophos;i="5.76,332,1592895600"; d="scan'208";a="472303674" Received: from mrabeda-mobl.ger.corp.intel.com ([10.249.158.203]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2020 09:53:49 -0700 From: "Maciej Rabeda" To: devel@edk2.groups.io Cc: Jiaxin Wu , Siyuan Fu Subject: [PATCH v1] NetworkPkg/UefiPxeBcDxe: Fix PXE_BOOT_SERVERS usage in boot info parse flow Date: Wed, 19 Aug 2020 18:53:38 +0200 Message-Id: <20200819165338.681-1-maciej.rabeda@linux.intel.com> X-Mailer: git-send-email 2.24.0.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2876 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 Cc: Siyuan Fu Signed-off-by: Maciej Rabeda --- 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 ( =0D //=0D // Parse the boot server address.=0D - // If prompt/discover is disabled, get the first boot server from the bo= ot servers list.=0D - // Otherwise, parse the boot server Ipv4 address from next server addres= s field in DHCP header.=0D + // If prompt/discover is disabled, server list should be used and is pre= sent (DHCP option 43),=0D + // get the first boot server from the boot servers list.=0D + // Otherwise, parse the boot server IPv4 address from next server addres= s field in DHCP header.=0D // If all these fields are not available, use option 54 instead.=0D //=0D VendorOpt =3D &Cache4->VendorOpt;=0D - if (IS_DISABLE_PROMPT_MENU (VendorOpt->DiscoverCtrl) && IS_VALID_BOOT_SE= RVERS (VendorOpt->BitMap)) {=0D + if (IS_DISABLE_PROMPT_MENU (VendorOpt->DiscoverCtrl) &&=0D + IS_VALID_BOOT_SERVERS (VendorOpt->BitMap) &&=0D + IS_ENABLE_USE_SERVER_LIST (VendorOpt->DiscoverCtrl))=0D + {=0D Entry =3D VendorOpt->BootSvr;=0D if (VendorOpt->BootSvrLen >=3D sizeof (PXEBC_BOOT_SVR_ENTRY) && Entry-= >IpCnt > 0) {=0D CopyMem (=0D --=20 2.24.0.windows.2