]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Mtftp6Dxe/Mtftp6Impl.c
ArmPkg/ArmPkg.dsc: Add missing components
[mirror_edk2.git] / NetworkPkg / Mtftp6Dxe / Mtftp6Impl.c
index 4a4e5b192c27f533c6c4ba36b4b233fbe7186109..067b1f53ba0612daf530c3db0383c3a6818c29de 100644 (file)
 \r
   Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
 \r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -115,11 +109,11 @@ EfiMtftp6GetModeData (
                                  - This is NULL.\r
                                  - MtftpConfigData.StationIp is neither zero nor one\r
                                    of the configured IP addresses in the underlying IPv6 driver.\r
-                                 - MtftpCofigData.ServerIp is not a valid IPv6 unicast address.\r
+                                 - MtftpConfigData.ServerIp is not a valid IPv6 unicast address.\r
                                  Note: It does not match the UEFI 2.3 Specification.\r
   @retval  EFI_ACCESS_DENIED     - The configuration could not be changed at this time because there\r
                                    is some MTFTP background operation in progress.\r
-                                 - MtftpCofigData.LocalPort is already in use.\r
+                                 - MtftpConfigData.LocalPort is already in use.\r
                                  Note: It does not match the UEFI 2.3 Specification.\r
   @retval  EFI_NO_MAPPING        The underlying IPv6 driver was responsible for choosing a source\r
                                  address for this instance, but no source address was available for use.\r
@@ -197,6 +191,19 @@ EfiMtftp6Configure (
                           UDP_IO_UDP6_VERSION,\r
                           NULL\r
                           );\r
+      if (Instance->UdpIo != NULL) {\r
+        Status = gBS->OpenProtocol (\r
+                        Instance->UdpIo->UdpHandle,\r
+                        &gEfiUdp6ProtocolGuid,\r
+                        (VOID **) &Udp6,\r
+                        Service->Image,\r
+                        Instance->Handle,\r
+                        EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER\r
+                        );\r
+        if (EFI_ERROR (Status)) {\r
+          goto ON_EXIT;\r
+        }\r
+      }\r
     }\r
 \r
     if (Instance->UdpIo == NULL) {\r
@@ -626,8 +633,6 @@ EfiMtftp6Poll (
   //\r
   if (Instance->Config == NULL) {\r
     return EFI_NOT_STARTED;\r
-  } else if (Instance->InDestroy) {\r
-    return EFI_DEVICE_ERROR;\r
   }\r
 \r
   Udp6 = Instance->UdpIo->Protocol.Udp6;\r