Reviewed-by: Fu Siyuan <[email protected]>



> -----Original Message-----
> From: Wu, Jiaxin
> Sent: Friday, December 1, 2017 4:39 PM
> To: [email protected]
> Cc: Ye, Ting <[email protected]>; Fu, Siyuan <[email protected]>;
> Karunakar P <[email protected]>; Wu, Jiaxin <[email protected]>
> Subject: [Patch 2/2] NetworkPkg/Dhcp6Dxe: Check Media status before
> starting DHCP process.
> 
> Cc: Ye Ting <[email protected]>
> Cc: Fu Siyuan <[email protected]>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Karunakar P <[email protected]>
> Signed-off-by: Wu Jiaxin <[email protected]>
> ---
>  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
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to