[PATCH v3 2/5] NetworkPkg/HttpDxe: Decofigure Tcp6 before reconfiguring


Oliver Steffen
 

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@...>
---
NetworkPkg/HttpDxe/HttpProto.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c
index cd54c574044b..33ae622c3f0b 100644
--- a/NetworkPkg/HttpDxe/HttpProto.c
+++ b/NetworkPkg/HttpDxe/HttpProto.c
@@ -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));
--
2.35.1

Join devel@edk2.groups.io to automatically receive all group messages.