]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Rrq.c
Sync the latest version from R8.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Mtftp4Dxe / Mtftp4Rrq.c
index 906cce8deb508863e14fa02ede3f57431d50fbcf..7c2114e7172a49fbc5003d1547853d059b64640c 100644 (file)
@@ -412,6 +412,18 @@ Mtftp4RrqConfigMcastPort (
     return Status;\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 = McastIo->Udp->Routes (McastIo->Udp, FALSE, &mZeroIp4Addr, &mZeroIp4Addr, &Config->GatewayIp);\r
+    if (EFI_ERROR (Status)) {\r
+      McastIo->Udp->Configure (McastIo->Udp, NULL);\r
+      return Status;\r
+    }\r
+  }\r
+\r
   //\r
   // join the multicast group\r
   //\r
@@ -534,22 +546,22 @@ Mtftp4RrqHandleOack (
 \r
         return Status;\r
       }\r
-\r
+    \r
       //\r
       // Update the parameters used.\r
       //\r
       if (Reply.BlkSize != 0) {\r
         Instance->BlkSize = Reply.BlkSize;\r
       }\r
-\r
+      \r
       if (Reply.Timeout != 0) {\r
         Instance->Timeout = Reply.Timeout;\r
-      }\r
-    }\r
-\r
+      }  \r
+    }    \r
+    \r
   } else {\r
     Instance->Master = TRUE;\r
-\r
+    \r
     if (Reply.BlkSize != 0) {\r
       Instance->BlkSize = Reply.BlkSize;\r
     }\r
@@ -558,7 +570,7 @@ Mtftp4RrqHandleOack (
       Instance->Timeout = Reply.Timeout;\r
     }\r
   }\r
-\r
+  \r
   //\r
   // Send an ACK to (Expected - 1) which is 0 for unicast download,\r
   // or tell the server we want to receive the Expected block.\r