]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.c
MdeModulePkg: Do not use hard coded TTL/ToS in PXE driver.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / UefiPxeBcDxe / PxeBcSupport.c
index 3016da73241134e16903823dd52cd8e6a7c47dd3..79c9a67f9e59fb07facc6940d69293a6abaf860e 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Support routines for PxeBc.\r
 \r
-Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2016, 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
@@ -42,6 +42,8 @@ PxeBcCommonNotify (
   @param  SubnetMask Pointer to the subnetmask of the station ip address.\r
   @param  Gateway    Pointer to the gateway ip address.\r
   @param  SrcPort    Pointer to the srouce port of the station.\r
+  @param  TTL        The time to live field of the IP header. \r
+  @param  ToS        The type of service field of the IP header.\r
 \r
   @retval EFI_SUCCESS           The configuration settings were set, changed, or reset successfully.\r
   @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,\r
@@ -65,7 +67,9 @@ PxeBcConfigureUdpWriteInstance (
   IN EFI_IPv4_ADDRESS   *StationIp,\r
   IN EFI_IPv4_ADDRESS   *SubnetMask,\r
   IN EFI_IPv4_ADDRESS   *Gateway,\r
-  IN OUT UINT16         *SrcPort\r
+  IN OUT UINT16         *SrcPort,\r
+  IN     UINT8          TTL,\r
+  IN     UINT8          ToS\r
   )\r
 {\r
   EFI_UDP4_CONFIG_DATA  Udp4CfgData;\r
@@ -74,8 +78,8 @@ PxeBcConfigureUdpWriteInstance (
   ZeroMem (&Udp4CfgData, sizeof (Udp4CfgData));\r
 \r
   Udp4CfgData.ReceiveTimeout = PXEBC_DEFAULT_LIFETIME;\r
-  Udp4CfgData.TypeOfService  = DEFAULT_ToS;\r
-  Udp4CfgData.TimeToLive     = DEFAULT_TTL;\r
+  Udp4CfgData.TypeOfService  = ToS;\r
+  Udp4CfgData.TimeToLive     = TTL;\r
   Udp4CfgData.AllowDuplicatePort = TRUE;\r
 \r
   CopyMem (&Udp4CfgData.StationAddress, StationIp, sizeof (*StationIp));\r