X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FIp4Dxe%2FIp4Impl.c;h=58adba7c8c158518dcaa5ff55d8378a46fc4dc28;hp=b9a294b19916dbf806469851400183bcce4e0e53;hb=7648748e99eeeadec38fda7568adb260c4acc861;hpb=d0d34cdf1d2752f0d7c3ca41af7e7ed29c221d11 diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c index b9a294b199..58adba7c8c 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c @@ -1,6 +1,6 @@ /** @file -Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 2016, 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 which accompanies this distribution. The full text of the license may be found at @@ -563,57 +563,6 @@ Ip4InitProtocol ( } -/** - The event handle for IP4 auto reconfiguration. The original default - interface and route table will be removed as the default. - - @param[in] Context The IP4 service binding instance. - -**/ -VOID -EFIAPI -Ip4AutoReconfigCallBackDpc ( - IN VOID *Context - ) -{ - IP4_SERVICE *IpSb; - - IpSb = (IP4_SERVICE *) Context; - NET_CHECK_SIGNATURE (IpSb, IP4_SERVICE_SIGNATURE); - - if (IpSb->State > IP4_SERVICE_UNSTARTED) { - IpSb->State = IP4_SERVICE_UNSTARTED; - } - - IpSb->Reconfig = TRUE; - - Ip4StartAutoConfig (&IpSb->Ip4Config2Instance); - - return ; -} - - -/** - Request Ip4AutoReconfigCallBackDpc as a DPC at TPL_CALLBACK. - - @param Event The event that is signalled. - @param Context The IP4 service binding instance. - -**/ -VOID -EFIAPI -Ip4AutoReconfigCallBack ( - IN EFI_EVENT Event, - IN VOID *Context - ) -{ - // - // Request Ip4AutoReconfigCallBackDpc as a DPC at TPL_CALLBACK - // - QueueDpc (TPL_CALLBACK, Ip4AutoReconfigCallBackDpc, Context); -} - - /** Configure the IP4 child. If the child is already configured, change the configuration parameter. Otherwise configure it @@ -724,32 +673,11 @@ Ip4ConfigProtocol ( } else { // - // Use the default address. If the default configuration hasn't - // been started, start it. + // Use the default address. Check the state. // if (IpSb->State == IP4_SERVICE_UNSTARTED) { - // - // Create the ReconfigEvent to start the new configuration. - // - if (IpSb->ReconfigEvent == NULL) { - Status = gBS->CreateEvent ( - EVT_NOTIFY_SIGNAL, - TPL_NOTIFY, - Ip4AutoReconfigCallBack, - IpSb, - &IpSb->ReconfigEvent - ); - - if (EFI_ERROR (Status)) { - goto ON_ERROR; - } - } - - Status = Ip4StartAutoConfig (&IpSb->Ip4Config2Instance); - - if (EFI_ERROR (Status)) { - goto CLOSE_RECONFIG_EVENT; - } + Status = EFI_NO_MAPPING; + goto ON_ERROR; } IpIf = IpSb->DefaultInterface; @@ -778,7 +706,7 @@ Ip4ConfigProtocol ( EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER ); if (EFI_ERROR (Status)) { - goto CLOSE_RECONFIG_EVENT; + goto ON_ERROR; } } InsertTailList (&IpIf->IpInstances, &IpInstance->AddrLink); @@ -797,12 +725,6 @@ Ip4ConfigProtocol ( return EFI_SUCCESS; -CLOSE_RECONFIG_EVENT: - if (IpSb->ReconfigEvent != NULL) { - gBS->CloseEvent (IpSb->ReconfigEvent); - IpSb->ReconfigEvent = NULL; - } - ON_ERROR: Ip4FreeRouteTable (IpInstance->RouteTable); IpInstance->RouteTable = NULL; @@ -2417,7 +2339,7 @@ Ip4TimerTicking ( // // Media transimit Unpresent to Present means new link movement is detected. // - if (!OldMediaPresent && IpSb->MediaPresent) { + if (!OldMediaPresent && IpSb->MediaPresent && (IpSb->Ip4Config2Instance.Policy == Ip4Config2PolicyDhcp)) { // // Signal the IP4 to run the dhcp configuration again. IP4 driver will free // old IP address related resource, such as route table and Interface, then