summaryrefslogtreecommitdiffstats
path: root/src/drivers/block
diff options
context:
space:
mode:
authorMichael Brown2011-03-03 23:08:50 +0100
committerMichael Brown2011-03-03 23:23:44 +0100
commit960dee6dd0c9c188bc922acab6acb744952f4866 (patch)
tree26272839d6a8dfdc5646b230583043103c061249 /src/drivers/block
parent[dns] Fix memory leak in settings applicator (diff)
downloadipxe-960dee6dd0c9c188bc922acab6acb744952f4866.tar.gz
ipxe-960dee6dd0c9c188bc922acab6acb744952f4866.tar.xz
ipxe-960dee6dd0c9c188bc922acab6acb744952f4866.zip
[iscsi] Change default initiator IQN
The default initiator IQN is "iqn.2000-09.org.etherboot:UNKNOWN". This is problematic for two reasons: a) the etherboot.org domain (and hence the associated IQN namespace) is not under the control of the iPXE project, and b) some targets (correctly) refuse to allow concurrent connections from different initiators using the same initiator IQN. Solve both problems by changing the default initiator IQN to be iqn.2010-04.org.ipxe:<hostname> if a hostname is set, or iqn.2010-04.org.ipxe:<uuid> if no hostname is set. Explicit initiator IQNs set via DHCP option 203 are not affected by this change. Unfortunately, this change is likely to break some existing configurations, where ACL rules have been put in place referring to the old default initiator IQN. Users may need to update ACLs, or force the use of the old IQN using an iPXE script line such as set initiator-iqn iqn.2000-09.org.etherboot:UNKNOWN or a dhcpd.conf option such as option iscsi-initiator-iqn "iqn.2000-09.org.etherboot:UNKNOWN" Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/block')
-rw-r--r--src/drivers/block/ibft.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/drivers/block/ibft.c b/src/drivers/block/ibft.c
index 9df362ac..f1609637 100644
--- a/src/drivers/block/ibft.c
+++ b/src/drivers/block/ibft.c
@@ -281,11 +281,12 @@ static int ibft_fill_nic ( struct ibft_nic *nic,
*
* @v initiator Initiator portion of iBFT
* @v strings iBFT string block descriptor
+ * @v iscsi iSCSI session
* @ret rc Return status code
*/
static int ibft_fill_initiator ( struct ibft_initiator *initiator,
- struct ibft_strings *strings ) {
- const char *initiator_iqn = iscsi_initiator_iqn();
+ struct ibft_strings *strings,
+ struct iscsi_session *iscsi ) {
int rc;
/* Fill in common header */
@@ -297,7 +298,7 @@ static int ibft_fill_initiator ( struct ibft_initiator *initiator,
/* Fill in hostname */
if ( ( rc = ibft_set_string ( strings, &initiator->initiator_name,
- initiator_iqn ) ) != 0 )
+ iscsi->initiator_iqn ) ) != 0 )
return rc;
DBG ( "iBFT initiator hostname = %s\n",
ibft_string ( strings, &initiator->initiator_name ) );
@@ -468,8 +469,8 @@ int ibft_describe ( struct iscsi_session *iscsi,
/* Fill in NIC, Initiator and Target blocks */
if ( ( rc = ibft_fill_nic ( &ibft->nic, &strings, netdev ) ) != 0 )
return rc;
- if ( ( rc = ibft_fill_initiator ( &ibft->initiator,
- &strings ) ) != 0 )
+ if ( ( rc = ibft_fill_initiator ( &ibft->initiator, &strings,
+ iscsi ) ) != 0 )
return rc;
if ( ( rc = ibft_fill_target ( &ibft->target, &strings,
iscsi ) ) != 0 )