summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/TcpDxe/TcpDispatcher.c
diff options
context:
space:
mode:
authorZhang Lubo <lubo.zhang@intel.com>2017-03-16 17:52:51 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2017-03-17 10:14:37 +0800
commitd555699b3ccda17b79abc436d191228921d2631c (patch)
treeab2a8b475969f38948d4ebed9f16bd011c3522ec /NetworkPkg/TcpDxe/TcpDispatcher.c
parent4bb89650f5dd77a9807915ced2f454b8d39a323f (diff)
downloadedk2-d555699b3ccda17b79abc436d191228921d2631c.tar.gz
edk2-d555699b3ccda17b79abc436d191228921d2631c.tar.bz2
edk2-d555699b3ccda17b79abc436d191228921d2631c.zip
NetworkPkg: Fix service binding issue in TCP dxe.
v2: Handle error case in SockCreateChild and fix typo issue when we destroy the socket Sock and its associated protocol control block, we need to first close the parent protocol, then remove the protocol from childHandle and last to free any data structures that allocated in CreateChild. But currently, we free the socket data (Socket ConfigureState) before removing the protocol form the childhandle. So if the up layer perform the driverbing stop to abort tcp session and send the tcp reset packet, it will failed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Diffstat (limited to 'NetworkPkg/TcpDxe/TcpDispatcher.c')
-rw-r--r--NetworkPkg/TcpDxe/TcpDispatcher.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/NetworkPkg/TcpDxe/TcpDispatcher.c b/NetworkPkg/TcpDxe/TcpDispatcher.c
index d4bc8ace55..9a352b1531 100644
--- a/NetworkPkg/TcpDxe/TcpDispatcher.c
+++ b/NetworkPkg/TcpDxe/TcpDispatcher.c
@@ -2,7 +2,7 @@
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>
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -423,30 +423,13 @@ TcpDetachPcb (
{
TCP_PROTO_DATA *ProtoData;
TCP_CB *Tcb;
- EFI_GUID *IpProtocolGuid;
- if (Sk->IpVersion == IP_VERSION_4) {
- IpProtocolGuid = &gEfiIp4ProtocolGuid;
- } else {
- IpProtocolGuid = &gEfiIp6ProtocolGuid;
- }
-
ProtoData = (TCP_PROTO_DATA *) Sk->ProtoReserved;
Tcb = ProtoData->TcpPcb;
ASSERT (Tcb != NULL);
TcpFlushPcb (Tcb);
-
- //
- // Close the IP protocol.
- //
- gBS->CloseProtocol (
- Tcb->IpInfo->ChildHandle,
- IpProtocolGuid,
- ProtoData->TcpService->IpIo->Image,
- Sk->SockHandle
- );
IpIoRemoveIp (ProtoData->TcpService->IpIo, Tcb->IpInfo);