]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c
Add a UNION definition (IP_IO_IP_PROTOOCL) for EFI_IP4/6_PROTOCOL and change IP_IO...
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Tcp4Dxe / Tcp4Misc.c
index 0014fc993f61218e01eb97d1060032207b97baa5..afcaba4ed6829a9bf9aca82cb863ed7874dfa822 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Misc support routines for tcp.\r
 \r
-Copyright (c) 2005 - 2009, Intel Corporation<BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2005 - 2010, 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
 http://opensource.org/licenses/bsd-license.php<BR>\r
@@ -171,7 +171,7 @@ TcpInitTcbPeer (
   @param  Local                 Pointer to the local (IP, Port).\r
   @param  Remote                Pointer to the remote (IP, Port).\r
 \r
-  @return  Pointer to the TCP_CB with the least number of wildcard, \r
+  @return  Pointer to the TCP_CB with the least number of wildcard,\r
            if NULL no match is found.\r
 \r
 **/\r
@@ -478,7 +478,7 @@ TcpGetRcvMss (
   ASSERT (Sock != NULL);\r
 \r
   TcpProto = (TCP4_PROTO_DATA *) Sock->ProtoReserved;\r
-  Ip       = (EFI_IP4_PROTOCOL *) (TcpProto->TcpService->IpIo->Ip);\r
+  Ip       = TcpProto->TcpService->IpIo->Ip.Ip4;\r
   ASSERT (Ip != NULL);\r
 \r
   Ip->GetModeData (Ip, &Ip4Mode, NULL, NULL);\r
@@ -500,6 +500,9 @@ TcpSetState (
   IN     UINT8   State\r
   )\r
 {\r
+  ASSERT (Tcb->State < (sizeof (mTcpStateName) / sizeof (CHAR16 *)));\r
+  ASSERT (State < (sizeof (mTcpStateName) / sizeof (CHAR16 *)));\r
+\r
   DEBUG (\r
     (EFI_D_INFO,\r
     "Tcb (%p) state %s --> %s\n",\r