X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=NetworkPkg%2FTcpDxe%2FTcpDispatcher.c;h=d4bc8ace5597604a0b6e0279efdaa64289690307;hb=0ab90add0f525eb9c91ce4bc2357298c4f357d09;hp=d3d2cb1c3a7d0359c9daef4d2589deccefd77ecd;hpb=216f79703b8cb8dc65abdd768bedb2bcdbc1a1f8;p=mirror_edk2.git diff --git a/NetworkPkg/TcpDxe/TcpDispatcher.c b/NetworkPkg/TcpDxe/TcpDispatcher.c index d3d2cb1c3a..d4bc8ace55 100644 --- a/NetworkPkg/TcpDxe/TcpDispatcher.c +++ b/NetworkPkg/TcpDxe/TcpDispatcher.c @@ -1,7 +1,8 @@ /** @file The implementation of a dispatch routine for processing TCP requests. - Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
+ (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
+ Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -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 { @@ -304,12 +305,10 @@ TcpFlushPcb ( ) { SOCKET *Sock; - TCP_PROTO_DATA *TcpProto; IpIoConfigIp (Tcb->IpInfo, NULL); Sock = Tcb->Sk; - TcpProto = (TCP_PROTO_DATA *) Sock->ProtoReserved; if (SOCK_IS_CONFIGURED (Sock)) { RemoveEntryList (&Tcb->List); @@ -327,8 +326,6 @@ TcpFlushPcb ( FreePool (Sock->DevicePath); Sock->DevicePath = NULL; } - - TcpSetVariableData (TcpProto->TcpService); } NetbufFreeList (&Tcb->SndQue); @@ -499,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 { @@ -537,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 { @@ -605,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);