diff options
author | Randy Pawell <randy_pawell@hp.com> | 2014-12-04 00:55:50 +0000 |
---|---|---|
committer | sfu5 <sfu5@Edk2> | 2014-12-04 00:55:50 +0000 |
commit | 8f586b85c3f617ba802e663b4b3b303e06140863 (patch) | |
tree | b5fb144b5039b9ebe8598c748e11936ac27f3a73 /NetworkPkg/TcpDxe/TcpDispatcher.c | |
parent | 35f910f08b58e978bc9251872635075d6f422e48 (diff) | |
download | edk2-platforms-8f586b85c3f617ba802e663b4b3b303e06140863.tar.xz |
NetworkPkg: Source fixes and cleanup for ARMGCC compiles
- Fix EFI_IPv4_ADDRESS usages to use a macro to copy the structure
instead of direct assignment, to avoid runtime alignment errors.
- Delete excess local variables that are initialized but otherwise unused.
- Add LibraryClasses.ARM & AARCH64 section in NetworkPkg.dsc file,
containing a CompilerIntrinsicsLib null-library, required for successful
standalone package builds (copied from MdeModulePkg.dsc).
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Randy Pawell <randy_pawell@hp.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16472 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg/TcpDxe/TcpDispatcher.c')
-rw-r--r-- | NetworkPkg/TcpDxe/TcpDispatcher.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/NetworkPkg/TcpDxe/TcpDispatcher.c b/NetworkPkg/TcpDxe/TcpDispatcher.c index 7b3d14dace..d4bc8ace55 100644 --- a/NetworkPkg/TcpDxe/TcpDispatcher.c +++ b/NetworkPkg/TcpDxe/TcpDispatcher.c @@ -1,6 +1,7 @@ /** @file
The implementation of a dispatch routine for processing TCP requests.
+ (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
@@ -98,12 +99,12 @@ Tcp4GetMode ( AccessPoint->UseDefaultAddress = Tcb->UseDefaultAddr;
- CopyMem (&AccessPoint->StationAddress, &Tcb->LocalEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
+ IP4_COPY_ADDRESS (&AccessPoint->StationAddress, &Tcb->LocalEnd.Ip);
- AccessPoint->SubnetMask = Tcb->SubnetMask;
+ IP4_COPY_ADDRESS (&AccessPoint->SubnetMask, &Tcb->SubnetMask);
AccessPoint->StationPort = NTOHS (Tcb->LocalEnd.Port);
- CopyMem (&AccessPoint->RemoteAddress, &Tcb->RemoteEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
+ IP4_COPY_ADDRESS (&AccessPoint->RemoteAddress, &Tcb->RemoteEnd.Ip);
AccessPoint->RemotePort = NTOHS (Tcb->RemoteEnd.Port);
AccessPoint->ActiveFlag = (BOOLEAN) (Tcb->State != TCP_LISTEN);
@@ -239,7 +240,7 @@ TcpBind ( UINT16 *RandomPort;
if (IpVersion == IP_VERSION_4) {
- CopyMem (&Local, &TcpAp->Tcp4Ap.StationAddress, sizeof (EFI_IPv4_ADDRESS));
+ IP4_COPY_ADDRESS (&Local, &TcpAp->Tcp4Ap.StationAddress);
Port = &TcpAp->Tcp4Ap.StationPort;
RandomPort = &mTcp4RandomPort;
} else {
@@ -495,12 +496,14 @@ TcpConfigurePcb ( IpCfgData.Ip4CfgData.TypeOfService = CfgData->Tcp4CfgData.TypeOfService;
IpCfgData.Ip4CfgData.TimeToLive = CfgData->Tcp4CfgData.TimeToLive;
IpCfgData.Ip4CfgData.UseDefaultAddress = CfgData->Tcp4CfgData.AccessPoint.UseDefaultAddress;
- IpCfgData.Ip4CfgData.SubnetMask = CfgData->Tcp4CfgData.AccessPoint.SubnetMask;
+ IP4_COPY_ADDRESS (
+ &IpCfgData.Ip4CfgData.SubnetMask,
+ &CfgData->Tcp4CfgData.AccessPoint.SubnetMask
+ );
IpCfgData.Ip4CfgData.ReceiveTimeout = (UINT32) (-1);
- CopyMem (
+ IP4_COPY_ADDRESS (
&IpCfgData.Ip4CfgData.StationAddress,
- &CfgData->Tcp4CfgData.AccessPoint.StationAddress,
- sizeof (EFI_IPv4_ADDRESS)
+ &CfgData->Tcp4CfgData.AccessPoint.StationAddress
);
} else {
@@ -533,8 +536,14 @@ TcpConfigurePcb ( //
// Get the default address information if the instance is configured to use default address.
//
- CfgData->Tcp4CfgData.AccessPoint.StationAddress = IpCfgData.Ip4CfgData.StationAddress;
- CfgData->Tcp4CfgData.AccessPoint.SubnetMask = IpCfgData.Ip4CfgData.SubnetMask;
+ IP4_COPY_ADDRESS (
+ &CfgData->Tcp4CfgData.AccessPoint.StationAddress,
+ &IpCfgData.Ip4CfgData.StationAddress
+ );
+ IP4_COPY_ADDRESS (
+ &CfgData->Tcp4CfgData.AccessPoint.SubnetMask,
+ &IpCfgData.Ip4CfgData.SubnetMask
+ );
TcpAp = (TCP_ACCESS_POINT *) &CfgData->Tcp4CfgData.AccessPoint;
} else {
@@ -601,7 +610,7 @@ TcpConfigurePcb ( CopyMem (&Tcb->LocalEnd.Ip, &CfgData->Tcp4CfgData.AccessPoint.StationAddress, sizeof (IP4_ADDR));
Tcb->LocalEnd.Port = HTONS (CfgData->Tcp4CfgData.AccessPoint.StationPort);
- Tcb->SubnetMask = CfgData->Tcp4CfgData.AccessPoint.SubnetMask;
+ IP4_COPY_ADDRESS (&Tcb->SubnetMask, &CfgData->Tcp4CfgData.AccessPoint.SubnetMask);
CopyMem (&Tcb->RemoteEnd.Ip, &CfgData->Tcp4CfgData.AccessPoint.RemoteAddress, sizeof (IP4_ADDR));
Tcb->RemoteEnd.Port = HTONS (CfgData->Tcp4CfgData.AccessPoint.RemotePort);
|