X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FTcp4Dxe%2FTcp4Dispatcher.c;h=0b845ee9adf996f726b7565e6389af083e3b8297;hp=c714dd3dae9c197dfa12a1dc559ea4c7f720616c;hb=e5e12de7d0a67111060c77723df39885c91a8ea5;hpb=98376cc51df0c0bd92a3436ec3309401d98c84e3 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; @@ -537,6 +554,15 @@ Tcp4ConfigurePcb ( } } + // + // The socket is bound, the 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 // @@ -681,8 +707,6 @@ Tcp4Dispatcher ( return Tcp4Route (Tcb, (TCP4_ROUTE_INFO *) Data); - default: - return EFI_UNSUPPORTED; } return EFI_SUCCESS;