Cc: Ye Ting <ting...@intel.com>
Cc: Fu Siyuan <siyuan...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Karunakar P <karunak...@amiindia.co.in>
Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
---
 NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c b/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c
index d8c0ad0..1107865 100644
--- a/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c
+++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c
@@ -1,9 +1,9 @@
 /** @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
   which accompanies this distribution.  The full text of the license may be 
found at
   http://opensource.org/licenses/bsd-license.php.
@@ -74,10 +74,11 @@ EfiDhcp6Start (
 {
   EFI_STATUS                   Status;
   EFI_TPL                      OldTpl;
   DHCP6_INSTANCE               *Instance;
   DHCP6_SERVICE                *Service;
+  BOOLEAN                      MediaPresent;
 
   if (This == NULL) {
     return EFI_INVALID_PARAMETER;
   }
 
@@ -99,10 +100,21 @@ EfiDhcp6Start (
   if (Instance->IaCb.Ia->State != Dhcp6Init) {
     return EFI_ALREADY_STARTED;
   }
 
   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;
 
   //
   // Send the solicit message to start S.A.R.R process.
   //
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to