summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-08-27 09:17:26 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-08-27 09:17:26 +0000
commite5e12de7d0a67111060c77723df39885c91a8ea5 (patch)
tree4a16a8e5a4b7c32a2c6bacfb71f065f86389dd3c /MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
parent98376cc51df0c0bd92a3436ec3309401d98c84e3 (diff)
downloadedk2-e5e12de7d0a67111060c77723df39885c91a8ea5.tar.gz
edk2-e5e12de7d0a67111060c77723df39885c91a8ea5.tar.bz2
edk2-e5e12de7d0a67111060c77723df39885c91a8ea5.zip
1. Sync the latest network stack. Add NetLibCreateIPv4DPathNode () in netlib library.
2. Fixed one porting bug in Udp4Impl.c git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3717 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c')
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
index c714dd3dae..0b845ee9ad 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
@@ -248,6 +248,16 @@ Tcp4FlushPcb (
if (SOCK_IS_CONFIGURED (Sock)) {
NetListRemoveEntry (&Tcb->List);
+ //
+ // Uninstall the device path protocl.
+ //
+ gBS->UninstallProtocolInterface (
+ Sock->SockHandle,
+ &gEfiDevicePathProtocolGuid,
+ Sock->DevicePath
+ );
+ NetFreePool (Sock->DevicePath);
+
TcpSetVariableData (TcpProto->TcpService);
}
@@ -428,12 +438,19 @@ Tcp4ConfigurePcb (
Tcb->TTL = CfgData->TimeToLive;
Tcb->TOS = CfgData->TypeOfService;
+ Tcb->UseDefaultAddr = CfgData->AccessPoint.UseDefaultAddress;
+
NetCopyMem (&Tcb->LocalEnd.Ip, &CfgData->AccessPoint.StationAddress, sizeof (IP4_ADDR));
Tcb->LocalEnd.Port = HTONS (CfgData->AccessPoint.StationPort);
Tcb->SubnetMask = CfgData->AccessPoint.SubnetMask;
- NetCopyMem (&Tcb->RemoteEnd.Ip, &CfgData->AccessPoint.RemoteAddress, sizeof (IP4_ADDR));
- Tcb->RemoteEnd.Port = HTONS (CfgData->AccessPoint.RemotePort);
+ if (CfgData->AccessPoint.ActiveFlag) {
+ NetCopyMem (&Tcb->RemoteEnd.Ip, &CfgData->AccessPoint.RemoteAddress, sizeof (IP4_ADDR));
+ Tcb->RemoteEnd.Port = HTONS (CfgData->AccessPoint.RemotePort);
+ } else {
+ Tcb->RemoteEnd.Ip = 0;
+ Tcb->RemoteEnd.Port = 0;
+ }
Option = CfgData->ControlOption;
@@ -538,6 +555,15 @@ Tcp4ConfigurePcb (
}
//
+ // The socket is bound, the <SrcIp, SrcPort, DstIp, DstPort> is
+ // determined, construct the IP device path and install it.
+ //
+ Status = TcpInstallDevicePath (Sk);
+ if (EFI_ERROR (Status)) {
+ goto OnExit;
+ }
+
+ //
// update state of Tcb and socket
//
if (CfgData->AccessPoint.ActiveFlag == FALSE) {
@@ -681,8 +707,6 @@ Tcp4Dispatcher (
return Tcp4Route (Tcb, (TCP4_ROUTE_INFO *) Data);
- default:
- return EFI_UNSUPPORTED;
}
return EFI_SUCCESS;