NetworkPkg/HttpDxe: Decofigure Tcp6 before reconfiguring

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2720

Check if the state of the HTTP instance is HTTP_STATE_TCP_CONNECTED, or
HTTP_STATE_TCP_CLOSED and de-configure the Tcp6 instance before
configuring it again.

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Oliver Steffen 2022-03-22 14:30:05 +01:00 committed by mergify[bot]
parent 38a9afd0fb
commit 3974aa539e
1 changed files with 12 additions and 0 deletions

View File

@ -1168,6 +1168,18 @@ HttpConfigureTcp6 (
Tcp6Option->KeepAliveInterval = HTTP_KEEP_ALIVE_INTERVAL;
Tcp6Option->EnableNagle = TRUE;
if ((HttpInstance->State == HTTP_STATE_TCP_CONNECTED) ||
(HttpInstance->State == HTTP_STATE_TCP_CLOSED))
{
Status = HttpInstance->Tcp6->Configure (HttpInstance->Tcp6, NULL);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "HttpConfigureTcp6(NULL) - %r\n", Status));
return Status;
}
HttpInstance->State = HTTP_STATE_TCP_UNCONFIGED;
}
Status = HttpInstance->Tcp6->Configure (HttpInstance->Tcp6, Tcp6CfgData);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "HttpConfigureTcp6 - %r\n", Status));