diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c index 1db4c667d7..87804145f4 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.
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
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))) {