[iscsi] Fix iBFT when no explicit initiator name setting exists
authorMichael Brown <mcb30@ipxe.org>
Wed, 10 May 2017 14:30:51 +0000 (15:30 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 10 May 2017 15:01:47 +0000 (16:01 +0100)
commita19ac24971214e6b14b9c50b377c24079523dbb5
tree65ce75177bffc8a8af490dde48330c176be597a0
parent785389c2ba84870e003c23304ca88aa4ec1f144d
[iscsi] Fix iBFT when no explicit initiator name setting exists

Commit 7cfdd76 ("[block] Describe all SAN devices via ACPI tables")
changed the definition of the iSCSI initiator IQN in the iBFT to
represent a common initiator IQN used for all iSCSI sessions, and
attempted to calculate this common initiator IQN by fetching the
common ${initiator-iqn} setting.

This fails when no explicit ${initiator-iqn} has been specified
(i.e. when an initiator IQN has instead been constructed from either
the hostname or system UUID), and results in an empty initiator IQN in
the iBFT.

Fix by using the initiator IQN of an arbitrary iSCSI session
present in the iBFT.

Debugged-by: Tal Aloni <tal.aloni.il@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/block/ibft.c