summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2017-11-29 14:34:26 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2017-12-13 16:25:44 +0800
commit5d34573df938ea7061fdd30a98acc71c4d4dc638 (patch)
tree610412bbe2b347fba8265422e4a6dab810028a93 /MdeModulePkg
parentf3b108a8ef353d041771a5514ea48f5088083633 (diff)
downloadedk2-5d34573df938ea7061fdd30a98acc71c4d4dc638.zip
edk2-5d34573df938ea7061fdd30a98acc71c4d4dc638.tar.gz
edk2-5d34573df938ea7061fdd30a98acc71c4d4dc638.tar.bz2
MdeModulePkg/Dhcp4Dxe: Check Media status before starting DHCP process.
This patch is to resolve the issue reported @ https://bugzilla.tianocore.org/show_bug.cgi?id=804. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Karunakar P <karunakarp@amiindia.co.in> Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c
index 1db4c66..8780414 100644
--- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c
+++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c
@@ -1,7 +1,7 @@
/** @file
This file implement the EFI_DHCP4_PROTOCOL interface.
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -780,6 +780,7 @@ EfiDhcp4Start (
{
DHCP_PROTOCOL *Instance;
DHCP_SERVICE *DhcpSb;
+ BOOLEAN MediaPresent;
EFI_STATUS Status;
EFI_TPL OldTpl;
@@ -809,6 +810,16 @@ EfiDhcp4Start (
goto ON_ERROR;
}
+ //
+ // Check Media Satus.
+ //
+ MediaPresent = TRUE;
+ NetLibDetectMedia (DhcpSb->Controller, &MediaPresent);
+ if (!MediaPresent) {
+ Status = EFI_NO_MEDIA;
+ goto ON_ERROR;
+ }
+
DhcpSb->IoStatus = EFI_ALREADY_STARTED;
if (EFI_ERROR (Status = DhcpInitRequest (DhcpSb))) {