]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
Sync the latest version from R8.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Mtftp4Dxe / Mtftp4Impl.c
index 3ce879253751426fc25531595a08e076c33112f5..0bd835b7b9aa2d2b7b020dbe7bf7507e909f0d83 100644 (file)
@@ -585,6 +585,16 @@ Mtftp4ConfigUnicastPort (
     return EFI_SUCCESS;\r
   }\r
 \r
+  if (!Config->UseDefaultSetting && !EFI_IP4_EQUAL (&mZeroIp4Addr, &Config->GatewayIp)) {\r
+    //\r
+    // The station IP address is manually configured and the Gateway IP is not 0.\r
+    // Add the default route for this UDP instance.\r
+    //\r
+    Status = UdpIo->Udp->Routes (UdpIo->Udp, FALSE, &mZeroIp4Addr, &mZeroIp4Addr, &Config->GatewayIp);\r
+    if (EFI_ERROR (Status)) {\r
+      UdpIo->Udp->Configure (UdpIo->Udp, NULL);\r
+    }\r
+  }\r
   return Status;\r
 }\r
 \r