NetworkPkg/IScsiDxe/IScsiConfig.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
---
NetworkPkg/IScsiDxe/IScsiConfig.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c b/NetworkPkg/IScsiDxe/IScsiConfig.c
index 498221a339..c0dd305ecf 100644
--- a/NetworkPkg/IScsiDxe/IScsiConfig.c
+++ b/NetworkPkg/IScsiDxe/IScsiConfig.c
@@ -749,14 +749,15 @@ IScsiConvertAttemptConfigDataToIfrNvDataByKeyword (
}
CopyMem(IfrNvData->ISCSIDisplayAttemptList, AttemptNameList, ATTEMPT_NAME_LIST_SIZE);
+ ZeroMem (IfrNvData->ISCSIMacAddr, sizeof (IfrNvData->ISCSIMacAddr));
NET_LIST_FOR_EACH (Entry, &mPrivate->NicInfoList) {
NicInfo = NET_LIST_USER_STRUCT (Entry, ISCSI_NIC_INFO, Link);
IScsiMacAddrToStr (
- &NicInfo->PermanentAddress,
- NicInfo->HwAddressSize,
- NicInfo->VlanId,
- MacString
- );
+ &NicInfo->PermanentAddress,
+ NicInfo->HwAddressSize,
+ NicInfo->VlanId,
+ MacString
+ );
CopyMem (
IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr),
MacString,
@@ -764,7 +765,10 @@ IScsiConvertAttemptConfigDataToIfrNvDataByKeyword (
);
*(IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr)) = L'/';
- }
+ }
+ if (StrLen (IfrNvData->ISCSIMacAddr) != 0) {
+ *(IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr) - 1) = L'\0';
+ }
}
}
--
2.13.0.windows.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> > -----Original Message----- > From: Fu, Siyuan > Sent: Thursday, September 14, 2017 11:18 AM > To: edk2-devel@lists.01.org > Cc: Ye, Ting <ting.ye@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com> > Subject: [Patch] NetworkPkg: Remove the redundant '/' in the end of > returned ISCSIMacAddr keyword. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> > Cc: Ye Ting <ting.ye@intel.com> > Cc: Wu Jiaxin <jiaxin.wu@intel.com> > --- > NetworkPkg/IScsiDxe/IScsiConfig.c | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > > diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c > b/NetworkPkg/IScsiDxe/IScsiConfig.c > index 498221a339..c0dd305ecf 100644 > --- a/NetworkPkg/IScsiDxe/IScsiConfig.c > +++ b/NetworkPkg/IScsiDxe/IScsiConfig.c > @@ -749,14 +749,15 @@ > IScsiConvertAttemptConfigDataToIfrNvDataByKeyword ( > } > CopyMem(IfrNvData->ISCSIDisplayAttemptList, AttemptNameList, > ATTEMPT_NAME_LIST_SIZE); > > + ZeroMem (IfrNvData->ISCSIMacAddr, sizeof (IfrNvData->ISCSIMacAddr)); > NET_LIST_FOR_EACH (Entry, &mPrivate->NicInfoList) { > NicInfo = NET_LIST_USER_STRUCT (Entry, ISCSI_NIC_INFO, Link); > IScsiMacAddrToStr ( > - &NicInfo->PermanentAddress, > - NicInfo->HwAddressSize, > - NicInfo->VlanId, > - MacString > - ); > + &NicInfo->PermanentAddress, > + NicInfo->HwAddressSize, > + NicInfo->VlanId, > + MacString > + ); > CopyMem ( > IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr), > MacString, > @@ -764,7 +765,10 @@ > IScsiConvertAttemptConfigDataToIfrNvDataByKeyword ( > ); > > *(IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr)) = L'/'; > - } > + } > + if (StrLen (IfrNvData->ISCSIMacAddr) != 0) { > + *(IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr) - 1) = > L'\0'; > + } > } > } > > -- > 2.13.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
© 2016 - 2024 Red Hat, Inc.