]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg:Generate the correct operational state of the interface.
authorZhang Lubo <lubo.zhang@intel.com>
Fri, 10 Feb 2017 03:05:34 +0000 (11:05 +0800)
committerJiaxin Wu <jiaxin.wu@intel.com>
Mon, 20 Feb 2017 02:09:30 +0000 (10:09 +0800)
Currently, When there are more than 9 Ethernet ports available,
'ifconfig6 -l' is not listing all the ports, only show the ports 0 to 9.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Santhapur Naveen <naveens@amiindia.co.in>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c

index 4e881fd6df20e3b65249ed141c67532a66bfea58..e309b69d775d4cdb9cdd05b94f3589d9d7cc6d72 100644 (file)
@@ -1438,11 +1438,12 @@ Ip6ConfigInitIfInfo (
   OUT EFI_IP6_CONFIG_INTERFACE_INFO  *IfInfo\r
   )\r
 {\r
-  IfInfo->Name[0] = L'e';\r
-  IfInfo->Name[1] = L't';\r
-  IfInfo->Name[2] = L'h';\r
-  IfInfo->Name[3] = (CHAR16) (L'0' + IpSb->Ip6ConfigInstance.IfIndex);\r
-  IfInfo->Name[4] = 0;\r
+  UnicodeSPrint (\r
+    IfInfo->Name,\r
+    sizeof (IfInfo->Name),\r
+    L"eth%x",\r
+    IpSb->Ip6ConfigInstance.IfIndex\r
+  );\r
 \r
   IfInfo->IfType        = IpSb->SnpMode.IfType;\r
   IfInfo->HwAddressSize = IpSb->SnpMode.HwAddressSize;\r