X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=NetworkPkg%2FDhcp6Dxe%2FDhcp6Impl.c;h=9ace833b98f7a922e6dc27990ee61bfc69029f23;hb=c6a14de3ef30291918f3b15436cf6a75db413eea;hp=934c03ed859a890ef3fff9841036b11f42ed4ab9;hpb=216f79703b8cb8dc65abdd768bedb2bcdbc1a1f8;p=mirror_edk2.git
diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c b/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c
index 934c03ed85..9ace833b98 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.
+ Copyright (c) 2009 - 2018, 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
@@ -76,6 +76,7 @@ EfiDhcp6Start (
EFI_TPL OldTpl;
DHCP6_INSTANCE *Instance;
DHCP6_SERVICE *Service;
+ EFI_STATUS MediaStatus;
if (This == NULL) {
return EFI_INVALID_PARAMETER;
@@ -101,13 +102,18 @@ EfiDhcp6Start (
}
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
- Instance->UdpSts = EFI_ALREADY_STARTED;
//
- // Need to clear initial time to make sure that elapsed-time
- // is set to 0 for first Solicit.
+ // Check Media Satus.
//
- Instance->StartTime = 0;
+ MediaStatus = EFI_SUCCESS;
+ NetLibDetectMediaWaitTimeout (Service->Controller, DHCP_CHECK_MEDIA_WAITING_TIME, &MediaStatus);
+ if (MediaStatus != EFI_SUCCESS) {
+ Status = EFI_NO_MEDIA;
+ goto ON_ERROR;
+ }
+
+ Instance->UdpSts = EFI_ALREADY_STARTED;
//
// Send the solicit message to start S.A.R.R process.
@@ -231,7 +237,7 @@ EfiDhcp6Stop (
}
Status = Instance->UdpSts;
}
-
+
ON_EXIT:
//
// Clean up the session data for the released Ia.
@@ -672,7 +678,7 @@ EfiDhcp6InfoRequest (
return Status;
}
- do {
+ do {
TimerStatus = gBS->CheckEvent (Timer);
if (!EFI_ERROR (TimerStatus)) {
Status = Dhcp6StartInfoRequest (
@@ -688,7 +694,7 @@ EfiDhcp6InfoRequest (
);
}
} while (TimerStatus == EFI_NOT_READY);
-
+
gBS->CloseEvent (Timer);
}
if (EFI_ERROR (Status)) {