mirror of https://github.com/acidanthera/audk.git
NetworkPkg: Fix potential bug if the iSCSI use dns protocol.
Since we use the Attempt and index as the attempt variable name instead of the MAC address plus index, we need to update this to check the whether the Controller handle is configured to use DNS protocol Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
This commit is contained in:
parent
2d67f2bae3
commit
df077b3e07
|
@ -1778,7 +1778,7 @@ IScsiDhcpIsConfigured (
|
|||
}
|
||||
|
||||
/**
|
||||
Check wheather the Controller handle is configured to use DNS protocol.
|
||||
Check whether the Controller handle is configured to use DNS protocol.
|
||||
|
||||
@param[in] Controller The handle of the controller.
|
||||
|
||||
|
@ -1799,6 +1799,7 @@ IScsiDnsIsConfigured (
|
|||
EFI_MAC_ADDRESS MacAddr;
|
||||
UINTN HwAddressSize;
|
||||
UINT16 VlanId;
|
||||
CHAR16 AttemptMacString[ISCSI_MAX_MAC_STRING_LEN];
|
||||
CHAR16 MacString[ISCSI_MAX_MAC_STRING_LEN];
|
||||
CHAR16 AttemptName[ISCSI_NAME_IFR_MAX_SIZE];
|
||||
|
||||
|
@ -1828,10 +1829,10 @@ IScsiDnsIsConfigured (
|
|||
UnicodeSPrint (
|
||||
AttemptName,
|
||||
(UINTN) 128,
|
||||
L"%s%d",
|
||||
MacString,
|
||||
L"Attempt %d",
|
||||
(UINTN) AttemptConfigOrder[Index]
|
||||
);
|
||||
|
||||
Status = GetVariable2 (
|
||||
AttemptName,
|
||||
&gEfiIScsiInitiatorNameProtocolGuid,
|
||||
|
@ -1844,7 +1845,9 @@ IScsiDnsIsConfigured (
|
|||
|
||||
ASSERT (AttemptConfigOrder[Index] == AttemptTmp->AttemptConfigIndex);
|
||||
|
||||
if (AttemptTmp->SessionConfigData.Enabled == ISCSI_DISABLED) {
|
||||
AsciiStrToUnicodeStrS (AttemptTmp->MacString, AttemptMacString, sizeof (AttemptMacString) / sizeof (AttemptMacString[0]));
|
||||
|
||||
if (AttemptTmp->SessionConfigData.Enabled == ISCSI_DISABLED || StrCmp (MacString, AttemptMacString)) {
|
||||
FreePool (AttemptTmp);
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue