]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Io.c
NetLib:
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Tcp4Dxe / Tcp4Io.c
index 963d730714c40c3d4c1364c334657024faac1276..39e8fbe9df9192180ea465c48bc68641e95e5b7c 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   I/O interfaces between TCP and IpIo.\r
 \r
-Copyright (c) 2005 - 2006, Intel Corporation<BR>\r
+Copyright (c) 2005 - 2009, Intel Corporation<BR>\r
 All rights reserved. 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
@@ -37,9 +37,9 @@ Tcp4RxCallback (
   )\r
 {\r
   if (EFI_SUCCESS == Status) {\r
-    TcpInput (Pkt, NetSession->Source, NetSession->Dest);\r
+    TcpInput (Pkt, NetSession->Source.Addr[0], NetSession->Dest.Addr[0]);\r
   } else {\r
-    TcpIcmpInput (Pkt, IcmpErr, NetSession->Source, NetSession->Dest);\r
+    TcpIcmpInput (Pkt, IcmpErr, NetSession->Source.Addr[0], NetSession->Dest.Addr[0]);\r
   }\r
 }\r
 \r
@@ -70,11 +70,16 @@ TcpSendIpPacket (
   SOCKET           *Sock;\r
   VOID             *IpSender;\r
   TCP4_PROTO_DATA  *TcpProto;\r
+  EFI_IP_ADDRESS   Source;\r
+  EFI_IP_ADDRESS   Destination;\r
+\r
+  Source.Addr[0]      = Src;\r
+  Destination.Addr[0] = Dest;\r
 \r
   if (NULL == Tcb) {\r
 \r
     IpIo     = NULL;\r
-    IpSender = IpIoFindSender (&IpIo, Src);\r
+    IpSender = IpIoFindSender (&IpIo, IP_VERSION_4, &Source);\r
 \r
     if (IpSender == NULL) {\r
       DEBUG ((EFI_D_WARN, "TcpSendIpPacket: No appropriate IpSender.\n"));\r
@@ -88,14 +93,14 @@ TcpSendIpPacket (
     IpSender = Tcb->IpInfo;\r
   }\r
 \r
-  Override.TypeOfService            = 0;\r
-  Override.TimeToLive               = 255;\r
-  Override.DoNotFragment            = FALSE;\r
-  Override.Protocol                 = EFI_IP_PROTO_TCP;\r
-  ZeroMem (&Override.GatewayAddress, sizeof (EFI_IPv4_ADDRESS));\r
-  CopyMem (&Override.SourceAddress, &Src, sizeof (EFI_IPv4_ADDRESS));\r
+  Override.Ip4OverrideData.TypeOfService            = 0;\r
+  Override.Ip4OverrideData.TimeToLive               = 255;\r
+  Override.Ip4OverrideData.DoNotFragment            = FALSE;\r
+  Override.Ip4OverrideData.Protocol                 = EFI_IP_PROTO_TCP;\r
+  ZeroMem (&Override.Ip4OverrideData.GatewayAddress, sizeof (EFI_IPv4_ADDRESS));\r
+  CopyMem (&Override.Ip4OverrideData.SourceAddress, &Src, sizeof (EFI_IPv4_ADDRESS));\r
 \r
-  Status = IpIoSend (IpIo, Nbuf, IpSender, NULL, NULL, Dest, &Override);\r
+  Status = IpIoSend (IpIo, Nbuf, IpSender, NULL, NULL, &Destination, &Override);\r
 \r
   if (EFI_ERROR (Status)) {\r
     DEBUG ((EFI_D_ERROR, "TcpSendIpPacket: return %r error\n", Status));\r