summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.c
diff options
context:
space:
mode:
authorFu Siyuan <siyuan.fu@intel.com>2016-04-29 15:09:20 +0800
committerFu Siyuan <siyuan.fu@intel.com>2016-05-05 09:08:26 +0800
commit60de3c19a7f875e4f9a012d275e8bb5ce4efb31d (patch)
treefc8b29ee1bf5acd05a5e013a99cb530efa078206 /MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.c
parent6f2f4116ebe4d3881757d0a08c8a660524775247 (diff)
downloadedk2-60de3c19a7f875e4f9a012d275e8bb5ce4efb31d.tar.gz
edk2-60de3c19a7f875e4f9a012d275e8bb5ce4efb31d.tar.bz2
edk2-60de3c19a7f875e4f9a012d275e8bb5ce4efb31d.zip
MdeModulePkg: Do not use hard coded TTL/ToS in PXE driver.
EFI_PXE_BASE_CODE_PROTOCOL has interface to set the TTL and ToS value, but not used by the UdpWrite() interface. The code always use a hard coded 16 for the TTL and 0 for ToS. This patch update the UpdWrite() to use the TTL and ToS which have been set by the SetParameters(). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-By: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Diffstat (limited to 'MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.c')
-rw-r--r--MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.c
index 3016da7324..79c9a67f9e 100644
--- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.c
+++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.c
@@ -1,7 +1,7 @@
/** @file
Support routines for PxeBc.
-Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -42,6 +42,8 @@ PxeBcCommonNotify (
@param SubnetMask Pointer to the subnetmask of the station ip address.
@param Gateway Pointer to the gateway ip address.
@param SrcPort Pointer to the srouce port of the station.
+ @param TTL The time to live field of the IP header.
+ @param ToS The type of service field of the IP header.
@retval EFI_SUCCESS The configuration settings were set, changed, or reset successfully.
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
@@ -65,7 +67,9 @@ PxeBcConfigureUdpWriteInstance (
IN EFI_IPv4_ADDRESS *StationIp,
IN EFI_IPv4_ADDRESS *SubnetMask,
IN EFI_IPv4_ADDRESS *Gateway,
- IN OUT UINT16 *SrcPort
+ IN OUT UINT16 *SrcPort,
+ IN UINT8 TTL,
+ IN UINT8 ToS
)
{
EFI_UDP4_CONFIG_DATA Udp4CfgData;
@@ -74,8 +78,8 @@ PxeBcConfigureUdpWriteInstance (
ZeroMem (&Udp4CfgData, sizeof (Udp4CfgData));
Udp4CfgData.ReceiveTimeout = PXEBC_DEFAULT_LIFETIME;
- Udp4CfgData.TypeOfService = DEFAULT_ToS;
- Udp4CfgData.TimeToLive = DEFAULT_TTL;
+ Udp4CfgData.TypeOfService = ToS;
+ Udp4CfgData.TimeToLive = TTL;
Udp4CfgData.AllowDuplicatePort = TRUE;
CopyMem (&Udp4CfgData.StationAddress, StationIp, sizeof (*StationIp));