diff options
author | Michael Brown | 2017-05-10 16:30:51 +0200 |
---|---|---|
committer | Michael Brown | 2017-05-10 17:01:47 +0200 |
commit | a19ac24971214e6b14b9c50b377c24079523dbb5 (patch) | |
tree | 65ce75177bffc8a8af490dde48330c176be597a0 /src/drivers | |
parent | [iscsi] Always send FirstBurstLength parameter (diff) | |
download | ipxe-a19ac24971214e6b14b9c50b377c24079523dbb5.tar.gz ipxe-a19ac24971214e6b14b9c50b377c24079523dbb5.tar.xz ipxe-a19ac24971214e6b14b9c50b377c24079523dbb5.zip |
[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>
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/block/ibft.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/drivers/block/ibft.c b/src/drivers/block/ibft.c index bb7812b3..f9918363 100644 --- a/src/drivers/block/ibft.c +++ b/src/drivers/block/ibft.c @@ -338,10 +338,12 @@ static int ibft_fill_nic ( struct ibft_nic *nic, * * @v initiator Initiator portion of iBFT * @v strings iBFT string block descriptor + * @v initiator_iqn Initiator IQN * @ret rc Return status code */ static int ibft_fill_initiator ( struct ibft_initiator *initiator, - struct ibft_strings *strings ) { + struct ibft_strings *strings, + const char *initiator_iqn ) { int rc; /* Fill in common header */ @@ -352,9 +354,8 @@ static int ibft_fill_initiator ( struct ibft_initiator *initiator, IBFT_FL_INITIATOR_FIRMWARE_BOOT_SELECTED ); /* Fill in initiator name */ - if ( ( rc = ibft_set_string_setting ( NULL, strings, - &initiator->initiator_name, - &initiator_iqn_setting ) ) != 0 ) + if ( ( rc = ibft_set_string ( strings, &initiator->initiator_name, + initiator_iqn ) ) != 0 ) return rc; DBG ( "iBFT initiator name = %s\n", ibft_string ( strings, &initiator->initiator_name ) ); @@ -613,7 +614,10 @@ static int ibft_install ( int ( * install ) ( struct acpi_header *acpi ) ) { /* Fill in Initiator block */ initiator = ( data + initiator_offset ); table->control.initiator = cpu_to_le16 ( initiator_offset ); - if ( ( rc = ibft_fill_initiator ( initiator, &strings ) ) != 0 ) + iscsi = list_first_entry ( &ibft_model.descs, struct iscsi_session, + desc.list ); + if ( ( rc = ibft_fill_initiator ( initiator, &strings, + iscsi->initiator_iqn ) ) != 0 ) goto err_initiator; /* Fill in NIC blocks */ |