From 8a5ef41ebb3dded5e9578ff4b716b87416b9c95f Mon Sep 17 00:00:00 2001 From: Jiaxin Wu Date: Wed, 29 Nov 2017 14:35:01 +0800 Subject: NetworkPkg/Dhcp6Dxe: 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 Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Karunakar P Signed-off-by: Wu Jiaxin Reviewed-by: Fu Siyuan --- NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'NetworkPkg/Dhcp6Dxe') 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.
+ Copyright (c) 2009 - 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 @@ -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; // -- cgit v1.2.3