From patchwork Sat Apr 23 07:01:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gary guo X-Patchwork-Id: 66513 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp51501qge; Sat, 23 Apr 2016 00:01:46 -0700 (PDT) X-Received: by 10.98.68.208 with SMTP id m77mr15963115pfi.25.1461394906443; Sat, 23 Apr 2016 00:01:46 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id h4si12443636paa.198.2016.04.23.00.01.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Apr 2016 00:01:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3C6141A22E6; Sat, 23 Apr 2016 00:01:45 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com [IPv6:2607:f8b0:4001:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CE7D51A224D for ; Sat, 23 Apr 2016 00:01:43 -0700 (PDT) Received: by mail-ig0-x22f.google.com with SMTP id bi2so30405246igb.0 for ; Sat, 23 Apr 2016 00:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=sXhzaomfnCanzPUfDWJw4HT5dTnqwOi+qLWEgEwNPVc=; b=YzjRTeVIU7WXxgODV+T05Ule91l5aKNOrQ/Aa28Rv7YCcSHZnpzam147+3mRttytPZ skNKa0YJbL69R8T+a+9GV8kLENUby3UJYsSv51zEbS6SV7Lr74bFgR63ewuYYCwIPkOn rWfz4Cf/WMJQ4+BBadszLI5AO2RoGrjDybZpw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=sXhzaomfnCanzPUfDWJw4HT5dTnqwOi+qLWEgEwNPVc=; b=Xpzh1muHDD8aXiJtxQaEjxw3gvs3NcRW/8zdq5p7TSs2QWFfmLdeN6vri4t9aUAE6i HTHpn8sd2pA0SrB9zX8ZRsdNn9fgCD7godr4a5f7nQDByI3p9VbABKtrnU2hmI1Ef4ic W1dQpeBlHBVMr6haDxU7QERPXO5+/C1ggH196yjAoYe2ho1ZIK8vJS4mR+XnTteYCrsX S3SZawc4wDxc63Yd3UQ1Gk+p+3o9u+YqjMr0Q4IhB9wtbDs/HJbl70N2rpzDvW9tQGMd EIcu0CnrqNqrG29oBfhh3GnuQuio5/QKJk3IXNZv5QvQIESXtfSK900vSDFyYcxWrwOk grZg== X-Gm-Message-State: AOPr4FWhapTniMjUukKUlfxY2DlDutA9A2UtxKLKBp4UWqYWAamCXVDmmZdFC4rAUXS5UOxz X-Received: by 10.50.160.195 with SMTP id xm3mr1221725igb.12.1461394903123; Sat, 23 Apr 2016 00:01:43 -0700 (PDT) Received: from localhost.localdomain ([104.238.45.87]) by smtp.gmail.com with ESMTPSA id b64sm5953431iob.8.2016.04.23.00.01.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 23 Apr 2016 00:01:42 -0700 (PDT) From: Heyi Guo To: edk2-devel@lists.01.org Date: Sat, 23 Apr 2016 15:01:16 +0800 Message-Id: <1461394876-31485-1-git-send-email-heyi.guo@linaro.org> X-Mailer: git-send-email 2.7.0 Subject: [edk2] [PATCH] MdeModulePkg/PXE: Ignore BootFileName if it is overloaded X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Feng Tian , chenzhihui , Heyi Guo , Jiaxin Wu , Siyuan Fu , Star Zeng MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: chenzhihui Signed-off-by: Heyi Guo Cc: Feng Tian Cc: Star Zeng Cc: Siyuan Fu Cc: Jiaxin Wu --- MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.7.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c index 6c06373..6108be5 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c @@ -228,9 +228,12 @@ PxeBcParseCachedDhcpPacket ( // If the bootfile is not present and bootfilename is present in dhcp packet, just parse it. // And do not count dhcp option header, or else will destroy the serverhostname. // - Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] = (EFI_DHCP4_PACKET_OPTION *) (&Offer->Dhcp4.Header.BootFileName[0] - + // Make sure "BootFileName" is not overloaded + if (Options[PXEBC_DHCP4_TAG_INDEX_OVERLOAD] == NULL || + (Options[PXEBC_DHCP4_TAG_INDEX_OVERLOAD]->Data[0] & PXEBC_DHCP4_OVERLOAD_FILE) == 0) { + Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] = (EFI_DHCP4_PACKET_OPTION *) (&Offer->Dhcp4.Header.BootFileName[0] - OFFSET_OF (EFI_DHCP4_PACKET_OPTION, Data[0])); - + } } //