From 9119637cb399963c4be9cfc8bf05a14f57e08813 Mon Sep 17 00:00:00 2001 From: tye1 Date: Fri, 10 Aug 2012 06:32:15 +0000 Subject: Fix issue that TCP server will not response to SYN packet from TCP client in TCP6 module. Signed-off-by: Ye Ting Reviewed-by: Ouyang Qian Reviewed-by: Fu Siyuan git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13606 6f19259b-4bc3-4df7-8a09-765794883524 --- NetworkPkg/TcpDxe/TcpDispatcher.c | 7 ++++++- NetworkPkg/TcpDxe/TcpIo.c | 6 ++++-- NetworkPkg/TcpDxe/TcpProto.h | 4 +++- 3 files changed, 13 insertions(+), 4 deletions(-) (limited to 'NetworkPkg') diff --git a/NetworkPkg/TcpDxe/TcpDispatcher.c b/NetworkPkg/TcpDxe/TcpDispatcher.c index eaa75a4ec4..3e6d34c63f 100644 --- a/NetworkPkg/TcpDxe/TcpDispatcher.c +++ b/NetworkPkg/TcpDxe/TcpDispatcher.c @@ -1,7 +1,7 @@ /** @file The implementation of a dispatch routine for processing TCP requests. - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2012, 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 @@ -334,6 +334,7 @@ TcpFlushPcb ( NetbufFreeList (&Tcb->SndQue); NetbufFreeList (&Tcb->RcvQue); Tcb->State = TCP_CLOSED; + Tcb->RemoteIpZero = FALSE; } /** @@ -711,6 +712,10 @@ TcpConfigurePcb ( if (Sk->IpVersion == IP_VERSION_6) { Tcb->Tick = TCP6_REFRESH_NEIGHBOR_TICK; + + if (NetIp6IsUnspecifiedAddr (&Tcb->RemoteEnd.Ip.v6)) { + Tcb->RemoteIpZero = TRUE; + } } TcpInsertTcb (Tcb); diff --git a/NetworkPkg/TcpDxe/TcpIo.c b/NetworkPkg/TcpDxe/TcpIo.c index cecb6d19c5..2b99927ec5 100644 --- a/NetworkPkg/TcpDxe/TcpIo.c +++ b/NetworkPkg/TcpDxe/TcpIo.c @@ -1,7 +1,7 @@ /** @file Implementation of I/O interfaces between TCP and IpIoLib. - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2012, 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 @@ -112,7 +112,9 @@ TcpSendIpPacket ( // It's IPv6 and this TCP segment belongs to a solid TCB, in such case // the destination address can't be overridden, so reset the Dest to NULL. // - Dest = NULL; + if (!Tcb->RemoteIpZero) { + Dest = NULL; + } } } diff --git a/NetworkPkg/TcpDxe/TcpProto.h b/NetworkPkg/TcpDxe/TcpProto.h index 88dfbb9d5c..ee35134833 100644 --- a/NetworkPkg/TcpDxe/TcpProto.h +++ b/NetworkPkg/TcpDxe/TcpProto.h @@ -1,7 +1,7 @@ /** @file TCP protocol header file. - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2012, 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 @@ -335,6 +335,8 @@ struct _TCP_CONTROL_BLOCK { UINT8 Ttl; EFI_IPv4_ADDRESS SubnetMask; + + BOOLEAN RemoteIpZero; ///< RemoteEnd.Ip is ZERO when configured. IP_IO_IP_INFO *IpInfo; ///< Pointer reference to Ip used to send pkt UINT32 Tick; ///< 1 tick = 200ms }; -- cgit v1.2.3