summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c b/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c
index d8c0ad0d24..1107865f42 100644
--- a/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c
+++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c
@@ -1,7 +1,7 @@
/** @file
This EFI_DHCP6_PROTOCOL interface implementation.
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 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
@@ -76,6 +76,7 @@ EfiDhcp6Start (
EFI_TPL OldTpl;
DHCP6_INSTANCE *Instance;
DHCP6_SERVICE *Service;
+ BOOLEAN MediaPresent;
if (This == NULL) {
return EFI_INVALID_PARAMETER;
@@ -101,6 +102,17 @@ EfiDhcp6Start (
}
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
+
+ //
+ // Check Media Satus.
+ //
+ MediaPresent = TRUE;
+ NetLibDetectMedia (Service->Controller, &MediaPresent);
+ if (!MediaPresent) {
+ Status = EFI_NO_MEDIA;
+ goto ON_ERROR;
+ }
+
Instance->UdpSts = EFI_ALREADY_STARTED;
//