From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web12.95178.1597864836457510857 for ; Wed, 19 Aug 2020 12:20:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jQsBA4XT; spf=pass (domain: redhat.com, ip: 207.211.31.81, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597864835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UXa3blKEv8YdlJ4p6gK3McgVAgud+dxyK+/CazUbNws=; b=jQsBA4XTv7Zkk179Kf5jJEPAFJqvyfkLEaEAEAgolKuHB+CaULbQuIaOvpUIT671DaksHo dRubpx/JST2rsV/rwAOosWM5+aSbWZB/dgt5zCLSx5MLNNqhibhBP6D0u39homrp3HdLH5 +iOtBUpowu4ydom0a8waUEo4RzhWuEE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-385-y0GkBIPsOfeI_6KxrPwxXg-1; Wed, 19 Aug 2020 15:20:16 -0400 X-MC-Unique: y0GkBIPsOfeI_6KxrPwxXg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 16BDB186A577; Wed, 19 Aug 2020 19:20:14 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-226.rdu2.redhat.com [10.10.114.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id B4A83756C3; Wed, 19 Aug 2020 19:20:12 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v1] NetworkPkg/UefiPxeBcDxe: Fix PXE_BOOT_SERVERS usage in boot info parse flow From: "Laszlo Ersek" To: devel@edk2.groups.io, maciej.rabeda@linux.intel.com Cc: Jiaxin Wu , Siyuan Fu , Seven.ding@lcfuturecenter.com References: <20200819165338.681-1-maciej.rabeda@linux.intel.com> <2dde2087-e291-0232-62e2-a30cdf4e09b2@redhat.com> Message-ID: <590e1de9-9f8c-72df-205e-c767f788ecf3@redhat.com> Date: Wed, 19 Aug 2020 21:20:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <2dde2087-e291-0232-62e2-a30cdf4e09b2@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 08/19/20 20:13, Laszlo Ersek wrote: > On 08/19/20 18:53, Maciej Rabeda wrote: >> 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 >> 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 ( >> >> // >> // 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 ( >> > > I'm still undecided whether option#43 / tag#6 / bit#3 being clear means > we should *ignore* PXE_BOOT_SERVERS (tag#8), but I'm willing to defer to > you on that. So, I can give a cautious > > Reviewed-by: Laszlo Ersek > > for this patch. > > Regarding the feature freeze -- in theory, this is a bugfix. However, > before we merge it, it would be really nice to get feedback from the > original reporter (CC'd). > > I also intend to regression-test this patch, I'll report back. I've repeated my usual PXEv4 boot tests (using OVMF IA32X64 and ArmVirtQemu AARCH64 guests, covering shim + grub + vmlinuz + initrd); nothing seems to have regressed. Regression-tested-by: Laszlo Ersek Thanks Laszlo