diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2010-07-01 20:36:39 -0500 |
---|---|---|
committer | Mike Christie <michaelc@cs.wisc.edu> | 2010-07-01 20:52:42 -0500 |
commit | 906245284357a43db1e2d93efd63ae531db36a5e (patch) | |
tree | 256891932b5e36e8d1940805c4f40efd67b32da3 | |
parent | 5594649c6448318f1ce292d4701a12b0adf20c7e (diff) | |
download | open-iscsi-906245284357a43db1e2d93efd63ae531db36a5e.tar.gz |
iscsiadm: cleanup default port handling
discovery* and node mode use the port argument.
discovery* mode sets the default port based on
the discovery type. So this patch moves that
weird test to just node mode, where we are able
to simplify it by just checking if the port is
set or not.
-rw-r--r-- | usr/iscsiadm.c | 7 |
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; |