/** @file\r
Routines to process Rrq (download).\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\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
MTFTP4_OPTION Reply;\r
EFI_STATUS Status;\r
INTN Expected;\r
+ EFI_UDP4_PROTOCOL *Udp4;\r
\r
*Completed = FALSE;\r
\r
//\r
Instance->McastIp = Reply.McastIp;\r
Instance->McastPort = Reply.McastPort;\r
- Instance->McastUdpPort = UdpIoCreateIo (\r
- Instance->Service->Controller,\r
- Instance->Service->Image,\r
- Mtftp4RrqConfigMcastPort,\r
- UDP_IO_UDP4_VERSION,\r
- Instance\r
- );\r
+ if (Instance->McastUdpPort == NULL) {\r
+ Instance->McastUdpPort = UdpIoCreateIo (\r
+ Instance->Service->Controller,\r
+ Instance->Service->Image,\r
+ Mtftp4RrqConfigMcastPort,\r
+ UDP_IO_UDP4_VERSION,\r
+ Instance\r
+ );\r
+ if (Instance->McastUdpPort != NULL) {\r
+ Status = gBS->OpenProtocol (\r
+ Instance->McastUdpPort->UdpHandle,\r
+ &gEfiUdp4ProtocolGuid,\r
+ (VOID **) &Udp4,\r
+ Instance->Service->Image,\r
+ Instance->Handle,\r
+ EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ UdpIoFreeIo (Instance->McastUdpPort);\r
+ Instance->McastUdpPort = NULL;\r
+ return EFI_DEVICE_ERROR;\r
+ }\r
+ }\r
+ }\r
+\r
\r
if (Instance->McastUdpPort == NULL) {\r
return EFI_DEVICE_ERROR;\r