From 960dee6dd0c9c188bc922acab6acb744952f4866 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 3 Mar 2011 22:08:50 +0000 Subject: [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: if a hostname is set, or iqn.2010-04.org.ipxe: 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 --- src/drivers/block/ibft.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/block/ibft.c b/src/drivers/block/ibft.c index 9df362ac0..f16096377 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 ) -- cgit v1.2.3-55-g7522