From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web10.94505.1597860822471650903 for ; Wed, 19 Aug 2020 11:13:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RwuLsab1; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597860821; 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=/ZGKS6gcWNn9pgr+a87ZGw7EIJlm+faz7Gnr9KwwmGQ=; b=RwuLsab1Ap1Xb6osvHUn/B00zvANSrMXdrv7wZA+lrfWtG+dPJaA/KRiYOujv5NLYs2lw0 qb1CaboRh/KnxbP+jxY5e6NQFF5szKYrtwS9fv99mCg4bbi8zJLBF8BW7Ob2+uharsbM9i esL58NK4e6dYCYcZryfxu+5TUoxmbC4= 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-166-zZlbrdKYNs6ZCiYWXrAGUA-1; Wed, 19 Aug 2020 14:13:30 -0400 X-MC-Unique: zZlbrdKYNs6ZCiYWXrAGUA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 45F28801AF4; Wed, 19 Aug 2020 18:13:21 +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 1846E7E300; Wed, 19 Aug 2020 18:13:19 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v1] NetworkPkg/UefiPxeBcDxe: Fix PXE_BOOT_SERVERS usage in boot info parse flow 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> From: "Laszlo Ersek" Message-ID: <2dde2087-e291-0232-62e2-a30cdf4e09b2@redhat.com> Date: Wed, 19 Aug 2020 20:13:18 +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: <20200819165338.681-1-maciej.rabeda@linux.intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 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. Thanks, Laszlo