aboutsummaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorMichael Brown <mcb30@etherboot.org>2006-08-07 17:50:41 +0000
committerMichael Brown <mcb30@etherboot.org>2006-08-07 17:50:41 +0000
commit8a3f4b7de6b26eb277be57ec6422b21aed78a26c (patch)
tree592e89d392f8f337c1f71e402150e6bf010ec883 /src/tests
parentecdcdea1afb967a8d727a7a970cac5f2b7ae189a (diff)
downloadipxe-8a3f4b7de6b26eb277be57ec6422b21aed78a26c.zip
ipxe-8a3f4b7de6b26eb277be57ec6422b21aed78a26c.tar.gz
ipxe-8a3f4b7de6b26eb277be57ec6422b21aed78a26c.tar.bz2
Set a NUL terminator before calling inet_aton.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/dhcptest.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tests/dhcptest.c b/src/tests/dhcptest.c
index a4e8d10..ced38a5 100644
--- a/src/tests/dhcptest.c
+++ b/src/tests/dhcptest.c
@@ -25,14 +25,15 @@ static int test_dhcp_iscsi_boot ( struct net_device *netdev __unused,
memset ( &target, 0, sizeof ( target ) );
target.sin.sin_family = AF_INET;
target.sin.sin_port = htons ( ISCSI_PORT );
- target_iqn = strchr ( iscsiname, ':' ) + 1;
+ target_iqn = strchr ( iscsiname, ':' );
+ *target_iqn++ = '\0';
if ( ! target_iqn ) {
printf ( "Invalid iSCSI DHCP path\n" );
return -EINVAL;
}
inet_aton ( iscsiname, &target.sin.sin_addr );
- return test_iscsiboot ( initiator_iqn, &target, target_iqn );
+ return test_iscsiboot ( initiator_iqn, &target.st, target_iqn );
}
static int test_dhcp_boot ( struct net_device *netdev, char *filename ) {