]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c
1. Update the UdpIo to a combined UdpIo to support both v4 and v6 stack.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Dhcp4Dxe / Dhcp4Driver.c
index 1ca0589b900025f454447f80aace89682c353e92..76c55c4478bcf861292e049cb16ecdc684619464 100644 (file)
@@ -106,16 +106,16 @@ Dhcp4DriverBindingSupported (
   Configure the default UDP child to receive all the DHCP traffics\r
   on this network interface.\r
 \r
-  @param[in]  UdpIo                  The UDP IO port to configure\r
+  @param[in]  UdpIo                  The UDP IO to configure\r
   @param[in]  Context                The context to the function\r
 \r
-  @retval EFI_SUCCESS            The UDP IO port is successfully configured.\r
+  @retval EFI_SUCCESS            The UDP IO is successfully configured.\r
   @retval Others                 Failed to configure the UDP child.\r
 \r
 **/\r
 EFI_STATUS\r
 DhcpConfigUdpIo (\r
-  IN UDP_IO_PORT            *UdpIo,\r
+  IN UDP_IO                 *UdpIo,\r
   IN VOID                   *Context\r
   )\r
 {\r
@@ -139,7 +139,7 @@ DhcpConfigUdpIo (
   ZeroMem (&UdpConfigData.SubnetMask, sizeof (EFI_IPv4_ADDRESS));\r
   ZeroMem (&UdpConfigData.RemoteAddress, sizeof (EFI_IPv4_ADDRESS));\r
 \r
-  return UdpIo->Udp->Configure (UdpIo->Udp, &UdpConfigData);;\r
+  return UdpIo->Protocol.Udp4->Configure (UdpIo->Protocol.Udp4, &UdpConfigData);;\r
 }\r
 \r
 \r
@@ -162,7 +162,7 @@ Dhcp4CloseService (
   DhcpCleanLease (DhcpSb);\r
 \r
   if (DhcpSb->UdpIo != NULL) {\r
-    UdpIoFreePort (DhcpSb->UdpIo);\r
+    UdpIoFreeIo (DhcpSb->UdpIo);\r
     DhcpSb->UdpIo = NULL;\r
   }\r
 \r
@@ -237,7 +237,13 @@ Dhcp4CreateService (
     goto ON_ERROR;\r
   }\r
 \r
-  DhcpSb->UdpIo = UdpIoCreatePort (Controller, ImageHandle, DhcpConfigUdpIo, NULL);\r
+  DhcpSb->UdpIo = UdpIoCreateIo (\r
+                    Controller,\r
+                    ImageHandle,\r
+                    DhcpConfigUdpIo,\r
+                    UDP_IO_UDP4_VERSION,\r
+                    NULL\r
+                    );\r
 \r
   if (DhcpSb->UdpIo == NULL) {\r
     Status = EFI_OUT_OF_RESOURCES;\r