summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Lubo <lubo.zhang@intel.com>2017-02-10 10:47:39 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2017-02-20 10:09:08 +0800
commit770e463d063ed50309274b88a2660289eb23a2f4 (patch)
treefb2ee4adc58a63a7ce7c9117ab4e1e8f4259a590
parenteb470e05a3c7c251cfa50863ea119ba70e9777a3 (diff)
downloadedk2-platforms-770e463d063ed50309274b88a2660289eb23a2f4.tar.xz
MdeModulePkg:Generate the correct operational state of the interface.
Currently, When there are more than 9 Ethernet ports available, 'ifconfig -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>
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
index 131b03f771..a6a3da8fe8 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
@@ -1492,11 +1492,12 @@ Ip4Config2InitIfInfo (
OUT EFI_IP4_CONFIG2_INTERFACE_INFO *IfInfo
)
{
- IfInfo->Name[0] = L'e';
- IfInfo->Name[1] = L't';
- IfInfo->Name[2] = L'h';
- IfInfo->Name[3] = (CHAR16) (L'0' + IpSb->Ip4Config2Instance.IfIndex);
- IfInfo->Name[4] = 0;
+ UnicodeSPrint (
+ IfInfo->Name,
+ EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE,
+ L"eth%x",
+ IpSb->Ip4Config2Instance.IfIndex
+ );
IfInfo->IfType = IpSb->SnpMode.IfType;
IfInfo->HwAddressSize = IpSb->SnpMode.HwAddressSize;