diff options
author | Oliver Steffen <osteffen@redhat.com> | 2022-03-22 14:30:05 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-04-11 15:12:46 +0000 |
commit | 3974aa539ee6b0f9e00b9bb73458639384639301 (patch) | |
tree | 50c212d04ee1db72eeb3c8c91fea359a2857c6dd /NetworkPkg | |
parent | 38a9afd0fb0eda06a4fb9c3efd5bd2d191fe87b1 (diff) | |
download | edk2-3974aa539ee6b0f9e00b9bb73458639384639301.tar.gz edk2-3974aa539ee6b0f9e00b9bb73458639384639301.tar.bz2 edk2-3974aa539ee6b0f9e00b9bb73458639384639301.zip |
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>
Diffstat (limited to 'NetworkPkg')
-rw-r--r-- | NetworkPkg/HttpDxe/HttpProto.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c index cd54c57404..33ae622c3f 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));
|