summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr/iscsiadm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
index d372eca..a377cef 100644
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
@@ -2010,10 +2010,6 @@ main(int argc, char **argv)
goto free_ifaces;
}
- if (mode != MODE_DISCOVERY && mode != MODE_DISCOVERY2 && ip &&
- port == -1)
- port = ISCSI_LISTEN_PORT;
-
switch (mode) {
case MODE_HOST:
if ((rc = verify_mode_params(argc, argv, "HdmP", 0))) {
@@ -2100,6 +2096,9 @@ main(int argc, char **argv)
iface->hwaddress, iface->ipaddress);
}
+ if (ip && port == -1)
+ port = ISCSI_LISTEN_PORT;
+
rec = idbm_create_rec(targetname, tpgt, ip, port, iface, 1);
if (!rec) {
rc = -1;