summaryrefslogtreecommitdiffstats
path: root/src/drivers/block
diff options
context:
space:
mode:
authorMichael Brown2010-12-09 16:35:02 +0100
committerMichael Brown2010-12-09 16:35:02 +0100
commit94cdad9c0e17a2cdaac6c14d86897526fb3c4101 (patch)
tree0e26d401ad6c5cdcb7ad4af07d42b0a33f057c50 /src/drivers/block
parent[settings] Add fetch_ipv4_array_setting() (diff)
downloadipxe-94cdad9c0e17a2cdaac6c14d86897526fb3c4101.tar.gz
ipxe-94cdad9c0e17a2cdaac6c14d86897526fb3c4101.tar.xz
ipxe-94cdad9c0e17a2cdaac6c14d86897526fb3c4101.zip
[iscsi] Include both DNS addresses in iBFT, if available
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/block')
-rw-r--r--src/drivers/block/ibft.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/drivers/block/ibft.c b/src/drivers/block/ibft.c
index adf1d7d5..932a00b5 100644
--- a/src/drivers/block/ibft.c
+++ b/src/drivers/block/ibft.c
@@ -103,13 +103,18 @@ static void ibft_set_ipaddr ( struct ibft_ipaddr *ipaddr, struct in_addr in ) {
*
* @v ipaddr IP address field
* @v setting Configuration setting
- * @v tag DHCP option tag
+ * @v count Maximum number of IP addresses
*/
static void ibft_set_ipaddr_setting ( struct ibft_ipaddr *ipaddr,
- struct setting *setting ) {
- struct in_addr in;
- fetch_ipv4_setting ( NULL, setting, &in );
- ibft_set_ipaddr ( ipaddr, in );
+ struct setting *setting,
+ unsigned int count ) {
+ struct in_addr in[count];
+ unsigned int i;
+
+ fetch_ipv4_array_setting ( NULL, setting, in, count );
+ for ( i = 0 ; i < count ; i++ ) {
+ ibft_set_ipaddr ( &ipaddr[i], in[i] );
+ }
}
/**
@@ -233,12 +238,15 @@ static int ibft_fill_nic ( struct ibft_nic *nic,
IBFT_FL_NIC_FIRMWARE_BOOT_SELECTED );
/* Extract values from configuration settings */
- ibft_set_ipaddr_setting ( &nic->ip_address, &ip_setting );
+ ibft_set_ipaddr_setting ( &nic->ip_address, &ip_setting, 1 );
DBG ( "iBFT NIC IP = %s\n", ibft_ipaddr ( &nic->ip_address ) );
- ibft_set_ipaddr_setting ( &nic->gateway, &gateway_setting );
+ ibft_set_ipaddr_setting ( &nic->gateway, &gateway_setting, 1 );
DBG ( "iBFT NIC gateway = %s\n", ibft_ipaddr ( &nic->gateway ) );
- ibft_set_ipaddr_setting ( &nic->dns[0], &dns_setting );
- DBG ( "iBFT NIC DNS = %s\n", ibft_ipaddr ( &nic->dns[0] ) );
+ ibft_set_ipaddr_setting ( &nic->dns[0], &dns_setting,
+ ( sizeof ( nic->dns ) /
+ sizeof ( nic->dns[0] ) ) );
+ DBG ( "iBFT NIC DNS = %s", ibft_ipaddr ( &nic->dns[0] ) );
+ DBG ( ", %s\n", ibft_ipaddr ( &nic->dns[1] ) );
if ( ( rc = ibft_set_string_setting ( strings, &nic->hostname,
&hostname_setting ) ) != 0 )
return rc;