]> git.proxmox.com Git - mirror_edk2.git/commitdiff
EmbeddedPkg/AndroidFastbootTransportTcpDxe: remove broken hostname handling
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 24 Oct 2016 16:39:10 +0000 (17:39 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 28 Oct 2016 12:51:22 +0000 (13:51 +0100)
The fastboot TCP connection setup routine retrieves a hostname from a
UEFI variable 'hostname' that is scoped under a GUID gEfiHostnameVariableGuid
whose definition is missing from the code. Since the hostname is only printed
and then discarded, let's just drop the whole thing.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcp.c
EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcpDxe.inf

index 8ec78aeb534e5a3830eeeb8d3671e10179392093..7c008ac9722e86a8b600f1ac6651a7b3fcf7f464 100644 (file)
@@ -27,8 +27,6 @@
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
 \r
-#include <Guid/Hostname.h>\r
-\r
 #define IP4_ADDR_TO_STRING(IpAddr, IpAddrString) UnicodeSPrint (       \\r
                                                    IpAddrString,       \\r
                                                    16 * 2,             \\r
@@ -307,9 +305,6 @@ TcpFastbootTransportStart (
   EFI_HANDLE                   *HandleBuffer;\r
   EFI_IP4_MODE_DATA             Ip4ModeData;\r
   UINTN                         NumHandles;\r
-  UINTN                         HostnameSize = 256;\r
-  CHAR8                         Hostname[256];\r
-  CHAR16                        HostnameUnicode[256] = L"<no hostname>";\r
   CHAR16                        IpAddrString[16];\r
   UINTN                         Index;\r
 \r
@@ -442,28 +437,10 @@ TcpFastbootTransportStart (
   //\r
   IP4_ADDR_TO_STRING (Ip4ModeData.ConfigData.StationAddress, IpAddrString);\r
 \r
-  // Look up hostname\r
-  Status = gRT->GetVariable (\r
-                  L"Hostname",\r
-                  &gEfiHostnameVariableGuid,\r
-                  NULL,\r
-                  &HostnameSize,\r
-                  &Hostname\r
-                  );\r
-  if (!EFI_ERROR (Status) && HostnameSize != 0) {\r
-    AsciiStrToUnicodeStr (Hostname, HostnameUnicode);\r
-  }\r
-\r
-  // Hostname variable is not null-terminated.\r
-  Hostname[HostnameSize] = L'\0';\r
-\r
   mTextOut->OutputString (mTextOut, L"TCP Fastboot transport configured.");\r
   mTextOut->OutputString (mTextOut, L"\r\nIP address: ");\r
   mTextOut->OutputString (mTextOut ,IpAddrString);\r
   mTextOut->OutputString (mTextOut, L"\r\n");\r
-  mTextOut->OutputString (mTextOut, L"\r\nhostname: ");\r
-  mTextOut->OutputString (mTextOut, HostnameUnicode);\r
-  mTextOut->OutputString (mTextOut, L"\r\n");\r
 \r
   //\r
   // Start listening for a connection\r
index 4d777934e5a410931b4380c8974a7da80bdec693..89ff556b40cadf193737f6efe91d135ba3f0c4c0 100644 (file)
@@ -47,8 +47,5 @@
   MdeModulePkg/MdeModulePkg.dec\r
   EmbeddedPkg/EmbeddedPkg.dec\r
 \r
-[Guids]\r
-  gEfiHostnameVariableGuid\r
-\r
 [FixedPcd]\r
   gEmbeddedTokenSpaceGuid.PcdAndroidFastbootTcpPort\r